@header@
 
 
matplotlib.cbook
index
/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/cbook.py

A collection of utility functions and classes.  Many (but not all)
from the Python Cookbook -- hence the name cbook

 
Modules
       
StringIO
datetime
errno
locale
numpy.ma
numpy
os
re
sys
threading
time
traceback
types

 
Classes
       
__builtin__.dict(__builtin__.object)
Xlator
maxdict
__builtin__.list(__builtin__.object)
silent_list
__builtin__.object
Grouper
Bunch
CallbackRegistry
GetRealpathAndStat
MemoryMonitor
Null
RingBuffer
Sorter
Stack
converter
todate
todatetime
tofloat
toint
tostr
threading.Thread(threading._Verbose)
Scheduler
Idle
Timeout

 
class Bunch
    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:
 
  >>> point = Bunch(datum=2, squared=4, coord=12)
  >>> point.datum
 
  By: Alex Martelli
  From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308
 
  Methods defined here:
__init__(self, **kwds)

 
class CallbackRegistry
    Handle registering and disconnecting for a set of signals and
callbacks::
 
   signals = 'eat', 'drink', 'be merry'
 
   def oneat(x):
       print 'eat', x
 
   def ondrink(x):
       print 'drink', x
 
   callbacks = CallbackRegistry(signals)
 
   ideat = callbacks.connect('eat', oneat)
   iddrink = callbacks.connect('drink', ondrink)
 
   #tmp = callbacks.connect('drunk', ondrink) # this will raise a ValueError
 
   callbacks.process('drink', 123)    # will call oneat
   callbacks.process('eat', 456)      # will call ondrink
   callbacks.process('be merry', 456) # nothing will be called
   callbacks.disconnect(ideat)        # disconnect oneat
   callbacks.process('eat', 456)      # nothing will be called
 
  Methods defined here:
__init__(self, signals)
*signals* is a sequence of valid signals
connect(self, s, func)
register *func* to be called when a signal *s* is generated
func will be called
disconnect(self, cid)
disconnect the callback registered with callback id *cid*
process(self, s, *args, **kwargs)
process signal *s*.  All of the functions registered to receive
callbacks on *s* will be called with *\*args* and *\*\*kwargs*

 
class GetRealpathAndStat
     Methods defined here:
__call__(self, path)
__init__(self)

 
class Grouper(__builtin__.object)
    This class provides a lightweight way to group arbitrary objects
together into disjoint sets when a full-blown graph data structure
would be overkill.
 
Objects can be joined using :meth:`join`, tested for connectedness
using :meth:`joined`, and all disjoint sets can be retreived by
using the object as an iterator.
 
The objects being joined must be hashable.
 
For example:
 
>>> g = grouper.Grouper()
>>> g.join('a', 'b')
>>> g.join('b', 'c')
>>> g.join('d', 'e')
>>> list(g)
[['a', 'b', 'c'], ['d', 'e']]
>>> g.joined('a', 'b')
True
>>> g.joined('a', 'c')
True
>>> g.joined('a', 'd')
False
 
  Methods defined here:
__contains__(self, item)
__init__(self, init=[])
__iter__(self)
Iterate over each of the disjoint sets as a list.
 
The iterator is invalid if interleaved with calls to join().
clean(self)
Clean dead weak references from the dictionary
get_siblings(self, a)
Returns all of the items joined with *a*, including itself.
join(self, a, *args)
Join given arguments into the same set.  Accepts one or more
arguments.
joined(self, a, b)
Returns True if *a* and *b* are members of the same set.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Idle(Scheduler)
    Schedule callbacks when scheduler is idle
 
 
Method resolution order:
Idle
Scheduler
threading.Thread
threading._Verbose
__builtin__.object

Methods defined here:
__init__(self, func)
run(self)

Data and other attributes defined here:
waittime = 0.050000000000000003

Methods inherited from Scheduler:
stop(self)

Data and other attributes inherited from Scheduler:
id = 0
idlelock = <thread.lock object at 0x10e9168>

Methods inherited from threading.Thread:
__repr__(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data descriptors inherited from threading._Verbose:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class MemoryMonitor
     Methods defined here:
__call__(self)
__init__(self, nmax=20000)
clear(self)
plot(self, i0=0, isub=1, fig=None)
report(self, segments=4)
xy(self, i0=0, isub=1)

 
class Null
    Null objects always and reliably "do nothing."
 
  Methods defined here:
__call__(self, *args, **kwargs)
__delattr__(self, name)
__getattr__(self, name)
__init__(self, *args, **kwargs)
__nonzero__(self)
__repr__(self)
__setattr__(self, name, value)
__str__(self)

 
class RingBuffer
    class that implements a not-yet-full buffer
 
  Methods defined here:
__get_item__(self, i)
__init__(self, size_max)
append(self, x)
append an element at the end of the buffer
get(self)
Return a list of elements from the oldest to the newest.

 
class Scheduler(threading.Thread)
    Base class for timeout and idle scheduling
 
 
Method resolution order:
Scheduler
threading.Thread
threading._Verbose
__builtin__.object

Methods defined here:
__init__(self)
stop(self)

Data and other attributes defined here:
id = 0
idlelock = <thread.lock object at 0x10e9168>

Methods inherited from threading.Thread:
__repr__(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
run(self)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data descriptors inherited from threading._Verbose:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Sorter
    Sort by attribute or item
 
Example usage::
 
  sort = Sorter()
 
  list = [(1, 2), (4, 8), (0, 3)]
  dict = [{'a': 3, 'b': 4}, {'a': 5, 'b': 2}, {'a': 0, 'b': 0},
          {'a': 9, 'b': 9}]
 
 
  sort(list)       # default sort
  sort(list, 1)    # sort by index 1
  sort(dict, 'a')  # sort a list of dicts by key 'a'
 
  Methods defined here:
__call__ = byItem(self, data, itemindex=None, inplace=1)
byAttribute(self, data, attributename, inplace=1)
byItem(self, data, itemindex=None, inplace=1)
sort = byItem(self, data, itemindex=None, inplace=1)

 
class Stack
    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
 
  Methods defined here:
__call__(self)
return the current element, or None
__init__(self, default=None)
back(self)
move the position back and return the current element
bubble(self, o)
raise *o* to the top of the stack and return *o*.  *o* must be
in the stack
clear(self)
empty the stack
empty(self)
forward(self)
move the position forward and return the current element
home(self)
push the first element onto the top of the stack
push(self, o)
push object onto stack at current position - all elements
occurring later than the current position are discarded
remove(self, o)
remove element *o* from the stack

 
class Timeout(Scheduler)
    Schedule recurring events with a wait time in seconds
 
 
Method resolution order:
Timeout
Scheduler
threading.Thread
threading._Verbose
__builtin__.object

Methods defined here:
__init__(self, wait, func)
run(self)

Methods inherited from Scheduler:
stop(self)

Data and other attributes inherited from Scheduler:
id = 0
idlelock = <thread.lock object at 0x10e9168>

Methods inherited from threading.Thread:
__repr__(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data descriptors inherited from threading._Verbose:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Xlator(__builtin__.dict)
    All-in-one multiple-string-substitution class
 
Example usage::
 
  text = "Larry Wall is the creator of Perl"
  adict = {
  "Larry Wall" : "Guido van Rossum",
  "creator" : "Benevolent Dictator for Life",
  "Perl" : "Python",
  }
 
  print multiple_replace(adict, text)
 
  xlat = Xlator(adict)
  print xlat.xlat(text)
 
 
Method resolution order:
Xlator
__builtin__.dict
__builtin__.object

Methods defined here:
__call__(self, match)
Handler invoked for each regex *match*
xlat(self, text)
Translate *text*, returns the modified text.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object at 0x3f8ab3c120>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object at 0x1850a30>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class converter
    Base class for handling string -> python type with support for
missing values
 
  Methods defined here:
__call__(self, s)
__init__(self, missing='Null', missingval=None)
is_missing(self, s)

 
class maxdict(__builtin__.dict)
    A dictionary with a maximum size; this doesn't override all the
relevant methods to contrain size, just setitem, so use with
caution
 
 
Method resolution order:
maxdict
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self, maxsize)
__setitem__(self, k, v)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object at 0x3f8ab3c120>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object at 0x1854110>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class silent_list(__builtin__.list)
    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
 
 
Method resolution order:
silent_list
__builtin__.list
__builtin__.object

Methods defined here:
__init__(self, type, seq=None)
__repr__(self)
__str__(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from __builtin__.list:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iadd__(...)
x.__iadd__(y) <==> x+=y
__imul__(...)
x.__imul__(y) <==> x*=y
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__reversed__(...)
L.__reversed__() -- return a reverse iterator over the list
__rmul__(...)
x.__rmul__(n) <==> n*x
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__setslice__(...)
x.__setslice__(i, j, y) <==> x[i:j]=y
 
Use  of negative indices is not supported.
append(...)
L.append(object) -- append object to end
count(...)
L.count(value) -> integer -- return number of occurrences of value
extend(...)
L.extend(iterable) -- extend list by appending elements from the iterable
index(...)
L.index(value, [start, [stop]]) -> integer -- return first index of value
insert(...)
L.insert(index, object) -- insert object before index
pop(...)
L.pop([index]) -> item -- remove and return item at index (default last)
remove(...)
L.remove(value) -- remove first occurrence of value
reverse(...)
L.reverse() -- reverse *IN PLACE*
sort(...)
L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1

Data and other attributes inherited from __builtin__.list:
__new__ = <built-in method __new__ of type object at 0x3f8ab3a760>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class todate(converter)
    convert to a date or None
 
  Methods defined here:
__call__(self, s)
__init__(self, fmt='%Y-%m-%d', missing='Null', missingval=None)
use a :func:`time.strptime` format string for conversion

Methods inherited from converter:
is_missing(self, s)

 
class todatetime(converter)
    convert to a datetime or None
 
  Methods defined here:
__call__(self, s)
__init__(self, fmt='%Y-%m-%d', missing='Null', missingval=None)
use a :func:`time.strptime` format string for conversion

Methods inherited from converter:
is_missing(self, s)

 
class tofloat(converter)
    convert to a float or None
 
  Methods defined here:
__call__(self, s)
__init__(self, missing='Null', missingval=None)

Methods inherited from converter:
is_missing(self, s)

 
class toint(converter)
    convert to an int or None
 
  Methods defined here:
__call__(self, s)
__init__(self, missing='Null', missingval=None)

Methods inherited from converter:
is_missing(self, s)

 
class tostr(converter)
    convert to string or None
 
  Methods defined here:
__init__(self, missing='Null', missingval='')

Methods inherited from converter:
__call__(self, s)
is_missing(self, s)

 
Functions
       
allequal(seq)
Return *True* if all elements of *seq* compare equal.  If *seq* is
0 or 1 length, return *True*
allpairs(x)
return all possible pairs in sequence *x*
 
Condensed by Alex Martelli from this thread_ on c.l.python
 
.. _thread: 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
alltrue(seq)
Return *True* if all elements of *seq* evaluate to *True*.  If
*seq* is empty, return *False*.
dedent(s)
Remove excess indentation from docstring *s*.
 
Discards any leading blank lines, then removes up to n whitespace
characters from each line, where n is the number of leading
whitespace characters in the first line. It differs from
textwrap.dedent in its deletion of leading blank lines and its use
of the first non-blank line to determine the indentation.
 
It is also faster in most cases.
delete_masked_points(*args)
Find all masked and/or non-finite points in a set of arguments,
and return the arguments with only the unmasked points remaining.
 
Arguments can be in any of 5 categories:
 
1) 1-D masked arrays
2) 1-D ndarrays
3) ndarrays with more than one dimension
4) other non-string iterables
5) anything else
 
The first argument must be in one of the first four categories;
any argument with a length differing from that of the first
argument (and hence anything in category 5) then will be
passed through unchanged.
 
Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf.  No attempt is made to
extract a mask from categories 2, 3, and 4 if :meth:`np.isfinite`
does not yield a Boolean array.
 
All input arguments that are not passed unchanged are returned
as ndarrays after removing the points or rows corresponding to
masks in any of the arguments.
 
A vastly simpler version of this function was originally
written as a helper for Axes.scatter().
dict_delall(d, keys)
delete all of the *keys* from the :class:`dict` *d*
distances_along_curve(X)
Computes the distance between a set of successive points in N dimensions.
 
where X is an MxN array or matrix.  The distances between successive rows
is computed.  Distance is the standard Euclidean distance.
exception_to_str(s=None)
finddir(o, match, case=False)
return all attributes of *o* which match string in match.  if case
is True require an exact case match.
flatten(seq, scalarp=<function is_scalar at 0x1822578>)
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
get_recursive_filelist(args)
Recurs all the files and dirs in *args* ignoring symbolic links
and return the files as a list of strings
get_split_ind(seq, N)
*seq* is a list of words.  Return the index into seq such that::
 
    len(' '.join(seq[:ind])<=N
is_closed_polygon(X)
Tests whether first and last object in a sequence are the same.  These are
presumably coordinates on a polygonal curve, in which case this function
tests if that curve is closed.
is_numlike(obj)
return true if *obj* looks like a number
is_scalar(obj)
return true if *obj* is not string like and is not iterable
is_sequence_of_strings(obj)
Returns true if *obj* is iterable and contains strings
is_string_like(obj)
return true if *obj* looks like a string
is_writable_file_like(obj)
return true if *obj* looks like a file object with a *write* method
issubclass_safe(x, klass)
return issubclass(x, klass) and return False on a TypeError
isvector(X)
Like the Matlab (TM) function with the same name, returns true if
the supplied numpy array or matrix looks like a vector, meaning it
has a one non-singleton axis (i.e., it can have multiple axes, but
all must have length 1, except for one of them).
 
If you just want to see if the array has 1 axis, use X.ndim==1
iterable(obj)
return true if *obj* is iterable
less_simple_linear_interpolation(x, y, xi, extrap=False)
This function provides simple (but somewhat less so than
simple_linear_interpolation) linear interpolation.
simple_linear_interpolation will give a list of point between a
start and an end, while this does true linear interpolation at an
arbitrary set of points.
 
This is very inefficient linear interpolation meant to be used
only for a small number of points in relatively non-intensive use
cases.
listFiles(root, patterns='*', recurse=1, return_folders=0)
Recursively list files
 
from Parmar and Martelli in the Python Cookbook
mkdirs(newdir, mode=511)
onetrue(seq)
Return *True* if one element of *seq* is *True*.  It *seq* is
empty, return *False*.
path_length(X)
Computes the distance travelled along a polygonal curve in N dimensions.
 
 
where X is an MxN array or matrix.  Returns an array of length M consisting
of the distance along the curve at each point (i.e., the rows of X).
pieces(seq, num=2)
Break up the *seq* into *num* tuples
popall(seq)
empty a list
popd(d, *args)
Should behave like python2.3 :meth:`dict.pop` method; *d* is a
:class:`dict`::
 
  # returns value for key and deletes item; raises a KeyError if key
  # is not in dict
  val = popd(d, key)
 
  # returns value for key if key exists, else default.  Delete key,
  # val item if it exists.  Will not raise a KeyError
  val = popd(d, key, default)
print_cycles(objects, outstream=<open file '<stdout>', mode 'w' at 0x7fb560aa6198>, show_progress=False)
*objects*
    A list of objects to find cycles in.  It is often useful to
    pass in gc.garbage to find the cycles that are preventing some
    objects from being garbage collected.
 
*outstream*
    The stream for output.
 
*show_progress*
    If True, print the number of objects reached as they are found.
recursive_remove(path)
report_memory(i=0)
return the memory consumed by process
reverse_dict(d)
reverse the dictionary -- may lose data if values are not unique!
safezip(*args)
make sure *args* are equal len before zipping
simple_linear_interpolation(a, steps)
soundex(name, len=4)
soundex module conforming to Odell-Russell algorithm
strip_math(s)
remove latex formatting from mathtext
to_filehandle(fname, flag='r', return_opened=False)
*fname* can be a filename or a file handle.  Support for gzipped
files is automatic, if the filename ends in .gz.  *flag* is a
read/write flag for :func:`file`
unicode_safe(s)
unique(x)
Return a list of unique elements of *x*
unmasked_index_ranges(mask, compressed=True)
Find index ranges where *mask* is *False*.
 
*mask* will be flattened if it is not already 1-D.
 
Returns Nx2 :class:`numpy.ndarray` with each row the start and stop
indices for slices of the compressed :class:`numpy.ndarray`
corresponding to each of *N* uninterrupted runs of unmasked
values.  If optional argument *compressed* is *False*, it returns
the start and stop indices into the original :class:`numpy.ndarray`,
not the compressed :class:`numpy.ndarray`.  Returns *None* if there
are no unmasked values.
 
Example::
 
  y = ma.array(np.arange(5), mask = [0,0,1,0,0])
  ii = unmasked_index_ranges(ma.getmaskarray(y))
  # returns array [[0,2,] [2,4,]]
 
  y.compressed()[ii[1,0]:ii[1,1]]
  # returns array [3,4,]
 
  ii = unmasked_index_ranges(ma.getmaskarray(y), compressed=False)
  # returns array [[0, 2], [3, 5]]
 
  y.filled()[ii[1,0]:ii[1,1]]
  # returns array [3,4,]
 
Prior to the transforms refactoring, this was used to support
masked arrays in Line2D.
vector_lengths(X, P=2.0, axis=None)
Finds the length of a set of vectors in n dimensions.  This is
like the numpy norm function for vectors, but has the ability to
work over a particular axis of the supplied array or matrix.
 
Computes (sum((x_i)^P))^(1/P) for each {x_i} being the elements of X along
the given axis.  If *axis* is *None*, compute over all elements of X.
wrap(prefix, text, cols)
wrap *text* with *prefix* at length *cols*

 
Data
        generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 0)
get_realpath_and_stat = <matplotlib.cbook.GetRealpathAndStat instance at 0x1824098>
ls = (':', 'dotted')
ls_mapper = {'-': 'solid', '--': 'dashed', '-.': 'dashdot', ':': 'dotted', 'dashdot': '-.', 'dashed': '--', 'dotted': ':', 'solid': '-'}
major = 2
minor1 = 5
minor2 = 1
preferredencoding = 'UTF-8'
s = 'final'
tmp = 0
@footer@