import numpy as np
from sklearn.metrics import confusion_matrix
confusion_matrix(np.random.randint(0, 5, size=100),
np.random.randint(0, 5, size=100), normalize='ohnodontdoit')
should raise an error but runs fine with no normalization. I found this because I did normalize=True and it didn't do anything and didn't raise an error.