MAINT: fix incorrect usage of NotImplementedError, remove unused import.