/usr/share/pyshared/nitime/analysis/base.py is in python-nitime 0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 31 32 33 34 35 36 37 38 39 40 41 42 | from inspect import getargspec
from nitime import descriptors as desc
class BaseAnalyzer(desc.ResetMixin):
"""
Analyzer that implements the default data flow.
All analyzers inherit from this class at least have to
* implement a __init__ function to set parameters
* define the 'output' property
"""
@desc.setattr_on_read
def parameterlist(self):
plist = getargspec(self.__init__).args
plist.remove('self')
plist.remove('input')
return plist
@property
def parameters(self):
return dict([(p,
getattr(self, p, 'MISSING')) for p in self.parameterlist])
def __init__(self, input=None):
self.input = input
def set_input(self, input):
"""Set the input of the analyzer, if you want to reuse the analyzer
with a different input than the original """
self.reset()
self.input = input
def __repr__(self):
params = ', '.join(['%s=%r' % (p, getattr(self, p, 'MISSING'))
for p in self.parameterlist])
return '%s(%s)' % (self.__class__.__name__, params)
|