A collection of utility functions and classes FROM MATPLOTLIB. Many (but not all) from the Python Cookbook -- hence the name cbook.
Class |
|
Often we want to just collect a bunch of stuff together, naming each item of the bunch; a dictionary's OK for that, but a small do- nothing class is even handier, and prettier to use. Whenever you want to group a few variables:... |
Class |
|
Null objects always and reliably "do nothing." |
Class |
|
class that implements a not-yet-full buffer |
Class | silent |
override repr when returning a list of matplotlib artists to prevent long, meaningless output. This is meant to be used for a homogeneous list of a give type |
Class |
|
Sort by attribute or item |
Class |
|
Implement a stack where elements can be pushed on and you can move back and forth. But no pop. Should mimic home / back / forward in a browser. |
Class |
|
All-in-one multiple-string-substitution class |
Function | allequal |
return true if all elements of seq compare equal. If seq is 0 or 1 length, return True |
Function | allpairs |
Return all possible pairs in sequence x |
Function | alltrue |
Undocumented |
Function | dict |
delete all of the keys from the dict d |
Function | exception |
Undocumented |
Function | finddir |
return all attributes of o which match string in match. if case is True require an exact case match. |
Function | flatten |
this generator flattens nested containers such as |
Function | get |
Recurs all the files and dirs in args ignoring symbolic links and return the files as a list of strings |
Function | get |
seq is a list of words. Return the index into seq such that len(' '.join(seq[:ind])<=N |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | is |
Undocumented |
Function | iterable |
Undocumented |
Function | list |
Recursively list files from Parmar and Martelli in the Python Cookbook |
Function | mkdirs |
Undocumented |
Function | onetrue |
Undocumented |
Function | pieces |
Break up the seq into num tuples |
Function | popall |
empty a list |
Function | reverse |
reverse the dictionary -- may lose data if values are not uniq! |
Function | soundex |
soundex module conforming to Odell-Russell algorithm |
Function | strip |
remove latex formatting from mathtext |
Function | unique |
Return a list of unique elements of x |
Function | wrap |
wrap text with prefix at length cols |
Variable | major |
Undocumented |
Variable | minor1 |
Undocumented |
Variable | minor2 |
Undocumented |
Variable | s |
Undocumented |
Variable | tmp |
Undocumented |
Return all possible pairs in sequence x Condensed by Alex Martelli from this thread on comp.lang.python:: http://groups.google.com/groups?q=all+pairs+group:*python*&hl=en&lr=&ie=UTF-8&selm=mailman.4028.1096403649.5135.python-list%40python.org&rnum=1
return all attributes of o which match string in match. if case is True require an exact case match.
this generator flattens nested containers such as >>> l=( ('John', 'Hunter'), (1,23), [[[[42,(5,23)]]]]) so that >>> for i in flatten(l): print i, John Hunter 1 23 42 5 23 By: Composite of Holger Krekel and Luther Blissett From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/121294 and Recipe 1.12 in cookbook
Recurs all the files and dirs in args ignoring symbolic links and return the files as a list of strings