def unit_vector(data, axis=None, out=None):
    if out is None:
        data = numpy.array(data, dtype=numpy.float64, copy=True)
        if data.ndim == 1:
            data /= math.sqrt(numpy.dot(data, data))
            return data
    else:
        if out is not data:
            out[:] = numpy.array(data, copy=False)
        data = out
    length = numpy.atleast_1d(numpy.sum(data*data, axis))
    numpy.sqrt(length, length)
    if axis is not None:
        length = numpy.expand_dims(length, axis)
    data /= length
    if out is None:
        return data
Get a variable from the kernel language.
dataset/ETHPy150Open IEEERobotics/bot/bot/hardware/complex_hardware/transformations.py/unit_vector--crossover with--dataset/ETHPy150Open Calysto/metakernel/metakernel_python/metakernel_python.py/MetaKernelPython.get_variable