def METHOD_NAME(y_true: np.ndarray, y_pred: np.ndarray) -> float:
    """Compute the Adjusted Rand Score (ARS).
    Re-implementation to deal with over/underflow that is common with large
    datasets.
    Args:
        y_true: True labels
        y_pred: Predicted labels
    Returns:
        Adjusted Rand Score
    """
    (tn, fp), (fn, tp) = metrics.pair_confusion_matrix(y_true, y_pred)
    tn, tp, fp, fn = int(tn), int(tp), int(fp), int(fn)
    if fn == 0 and fp == 0:
        return 1.0
    return 2.0 * (tp * tn - fn * fp) / ((tp + fn) * (fn + tn) + (tp + fp) * (fp + tn))