Reimplemented filters in Python