def cosine_similarity(v1, v2):
    s = sum(v1.get(f, 0) * w for f, w in v2.items())
    s = float(s) / (l2_norm(v1) * l2_norm(v2) or 1)
    return s
Returns the cosine similarity of the given vectors.
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/cosine_similarity