def onehot(i, width, values=[0,1]):
    """
    >>> onehot(0, 5)
    [1, 0, 0, 0, 0]

    >>> onehot(3, 5)
    [0, 0, 0, 1, 0]

    >>> onehot(3, 5, values=[False, True])
    [False, False, False, True, False]
    """
    v = [values[0]] * width
    v[i] = values[1]
    return v