def METHOD_NAME(centroids, data, labels, pairwise_distances, zero_point, C):
    # Get the number of points associated with each centroid
    counts = np.bincount(labels, minlength=C)
    # more bincounts using the positions as weights produce the unnormalized
    #  updated centroid locations (have to do each dimension separately since
    #  a weight cannot be a vector)
    for idx in range(data.shape[1]):
        centroids[:, idx] = np.bincount(
            labels, weights=data[:, idx], minlength=C
        )
    # would have been nice if numpy offered a combined amin/argmin to avoid
    #  iterating over pairwise_distances twice
    distance_sum = np.sum(np.amin(pairwise_distances, axis=1))
    # To avoid introducing divide by zero errors
    # If a centroid has no weight, we'll do no normalization
    # This will keep its coordinates defined.
    counts = np.maximum(counts, np.ones((1,), dtype=np.uint64))
    centroids /= counts[:, np.newaxis]
    return distance_sum