def clf2D_slope_intercept(coef=None, intercept=None, clf=None):
    """
    Gets the slop an intercept for the separating hyperplane of a linear
    classifier fit on a two dimensional dataset.

    Parameters
    ----------
    coef:
        The classification normal vector.

    intercept:
        The classifier intercept.

    clf: subclass of sklearn.linear_model.base.LinearClassifierMixin
        A sklearn classifier with attributes coef_ and intercept_

    Output
    ------
    slope, intercept
    """

    if clf is not None:
        coef = clf.coef_.reshape(-1)
        intercept = float(clf.intercept_)
    else:
        assert coef is not None and intercept is not None

    slope = - coef[0] / coef[1]
    intercept = - intercept / coef[1]

    return slope, intercept