def jaccard_index_pair_counts(a, b, c):
    """
    Compute the Jaccard index from pair counts; helper function.

    Arguments:
    a: number of pairs of elements that are clustered in both partitions
    b: number of pairs of elements that are clustered in first but not second partition
    c: number of pairs of elements that are clustered in second but not first partition
    d: number of pairs of elements that are clustered in neither partition

    Example usage:
    In [1]: a = 1
    In [2]: b = 2
    In [3]: c = 2
    In [4]: d = 10
    In [5]: jaccard_index_pair_counts(a, b, c, d)
    Out[5]: 0.2
    """
    if a+b+c!=0:
        return float(a)/float(a+b+c)
    else:
        return 1.0