python extension for fast IRC mask matching and collapsing