def l2_norm(v):
    if isinstance(v, Vector):
        return v.l2_norm
    return sum(w * w for w in v.values()) ** 0.5
Returns the L2-norm of the given vector.
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/l2_norm