def jac(a, b):
    """return the Jaccard similarity of two sets"""
    if type(a) != set:
        a = set(a)
    if type(b) != set:
        b = set(b)

    n = len(a.intersection(b))
    return n / float(len(a) + len(b) - n)