Clamodel.py cleanup

No functional changes.

- Use `is` for type comparison
- Rename `filter` local variable to `filter_` to avoid name conflict with builtin
- Use `for...else`
- Whitespace