Return result of predict_proba, if an estimator supports it, or None.

def predict_proba(estimator, X):
    # type: (Any, Any) -> Optional[np.ndarray]
    """ Return result of predict_proba, if an estimator supports it, or None.
    """
    if is_probabilistic_classifier(estimator):
        try:
            proba, = estimator.predict_proba(X)
            return proba
        except NotImplementedError:
            return None
    else:
        return None