def accuracy(targ, pred, empty_score=0.0):
    """
    Computes accuracy between target and prediction array
    Parameters
    ----------
    targ : array-like, bool or numeric
    pred : array-like, bool or numeric
    Returns
    -------
    accuracy : float
        Best accuracy = 1.0
        Worst Accuracy = 1.0
        Target is empty (sum eq to zero) = empty_score
    """
    if targ.shape != pred.shape:
        raise ValueError("Shape mismatch: im1 and im2 must have the same shape.")

    return (targ==pred).mean()