def tanimoto_set_similarity(x: Iterable[X], y: Iterable[X]) -> float:
a, b = set(x), set(y)<EOL>union = a | b<EOL>if not union:<EOL><INDENT>return <NUM_LIT:0.0><EOL><DEDENT>return len(a & b) / len(union)<EOL>
Calculate the tanimoto set similarity.