def normalize(vector):
    d = sum(x * x for x in vector) ** 0.5
    return tuple(x / d for x in vector)
Normalizes the `vector` so that its length is 1. `vector` can have
dataset/ETHPy150Open fogleman/pg/pg/util.py/normalize