# ROC-AUC score in sklearn

I'm trying to understand ROC-curve and AUC characteristic for it and found that behaviour of sklearn function roc_auc_score diverges from my understanding:

roc_auc_score([1, 0, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]) # output: 0.5


As far as I undestand, ROC curve can be defined in the following way: $$ROC(x) = \max \{ TPR(\mathcal{C}_t) \mid FPR(\mathcal{C}_t) \leq x \}$$

Where $$TPR$$ and $$FPR$$ is true-positive rate and false-positive rate and $$\mathcal{C}_t$$ is a classifier with fixed threshold value equals to $$t$$.

In case where all predicted probabilities are equal we have only two different classifiers: one that always predict one class, and one that always predict another class. In this case we have two corner in our ROC-curve: $$(0, 0)$$ and $$(1, 1)$$. And by definition above the curve has a shape of corner: But why sklearn draws curve that shapes single line like this? How should I change the definition of curve to get this kind of picture?

It looks like we simply need to extend our family of classifiers. We are able to do this with a little bit of randomization. So, we can define classifier $$\mathcal{C}_t^p$$ in the following way: $$\begin{equation} \mathcal{C}_t^p(x) = \begin{cases} \texttt{+1}&, \texttt{if } C(x) > t\\ \texttt{-1}&, \texttt{if } C(x) < t\\ \texttt{+1 with probability } p \texttt{ and -1 with } 1-p&, \texttt{if } C(x) = t\\ \end{cases} \end{equation}$$
$$ROC(x) = \max \{ TPR(\mathcal{C}_t^p) \mid p \in [0..1] \wedge FPR(\mathcal{C}_t^p) \leq x \}$$