def setter_scalar(value, dim_x):
    if isscalar(value):
        v = eye(dim_x) * value
    else:
        v = array(value, dtype=float)
        dim_x = v.shape[0]

    if v.shape != (dim_x, dim_x):
        raise Exception('must have shape ({},{})'.format(dim_x, dim_x))
    return v
Returns a copy of 'value' as an numpy.array with dtype=float. Throws
dataset/ETHPy150Open rlabbe/filterpy/filterpy/common/helpers.py/setter_scalar