

def _write_filter(self, file, name, flt):
    plural = ''
    if flt.combined:
        plural = 's'
    file.write(('\ndef filter(%s%s):' % (self.signature, plural)))
    if (flt.active or flt.on_exception):
        file.write(' #')
        if flt.active:
            file.write('ACTIVE')
            if flt.on_exception:
                file.write(',')
        if flt.on_exception:
            file.write('EXCEPTION_TRUE')
    file.write('\n')
    file.write(('\t"""%s"""\n' % name))
    for l in flt.code:
        file.write(('\t%s\n' % l))

dataset/ETHPy150Open rproepp/spykeviewer/spykeviewer/plugin_framework/filter_manager.py FilterManager._write_filter/original