def distance(a, b): """ Slow version of ``add`` to simulate work """ return np.sum(np.sqrt(np.sum((a - b)**2, axis=1))) # Parallel: