util
index
/home/gerrit/cvs/brian/util.py

All functions used by Brian classes not specific to one class reside here

 
Modules
       
cPickle
itertools
level
math
os
pygame
random
sets
sys
time
types

 
Classes
       
__builtin__.list(__builtin__.object)
OptimizedList

 
class OptimizedList(__builtin__.list)
    
Method resolution order:
OptimizedList
__builtin__.list
__builtin__.object

Methods defined here:
__contains__(self, obj)
__delitem__(self, i)
add(self, spr)
extend(self, seq)
index(self, obj)
insert(self, pos, obj)
remove(self, obj)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'OptimizedList' objects>
list of weak references to the object (if defined)
ids = []

Methods inherited from __builtin__.list:
__add__(...)
x.__add__(y) <==> 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
__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
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__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
pop(...)
L.pop([index]) -> item -- remove and return item at index (default last)
reverse(...)
L.reverse() -- reverse *IN PLACE*
sort(...)
L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1

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

 
Functions
       
coor2dir(c)
Converts (1, -1) style coords to "NE' style coords
coor2rect(c)
Converts ((x,y),(x,y)) style coords to a Rect object
debug(*m)
multiblit(dest, im)
Blits ImageServer instance to surface. Assumes surface is large enough.
multiply_surf(surf, x=2, y=2)
Multiplies surfaces by x and y (repeating)
picklable(obj)
Checks whether object is picklable
preserveuniq(s)
Return a list of the elements in s in order, but without duplicates.
 
SOURCE:
    Alex Martelli
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
printtrace()
randcycle(l)
Yield random items from l.
subtractrect(outer, inner)
tiled_blit(src, dest, destrect=None, offset=(0, 0), srcrect=None)
Repeats blitting src to dest until destrect is filled.
touches(rect1, rect2)
Checks whether rect1 and rect2 touch each other.
uniq(s)
Return a list of the elements in s, but without duplicates.
 
For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],
unique("abcabc") some permutation of ["a", "b", "c"], and
unique(([1, 2], [2, 3], [1, 2])) some permutation of
[[2, 3], [1, 2]].
 
For best speed, all sequence elements should be hashable.  Then
unique() will usually work in linear time.
 
If not possible, the sequence elements should enjoy a total
ordering, and if list(s).sort() doesn't raise TypeError it's
assumed that they do enjoy a total ordering.  Then unique() will
usually work in O(N*log2(N)) time.
 
If that's not possible either, the sequence elements must support
equality-testing.  Then unique() will usually work in quadratic
time.
 
SOURCE:
    Tim Peters, "Remove duplicates from a sequence", in:
    Python Cookbook, 4 Juni 2001,
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560

 
Data
        division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)