def normalize(vector):
    '''Normalizes the `vector` so that its length is 1. `vector` can have
    any number of components.
    '''
    d = sum(x * x for x in vector) ** 0.5
    return tuple(x / d for x in vector)
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
    any number of components.