def uint_to_list_of_uints(uint, size, width):
    """
    Convert an unsigned integer into a list of unsigned integers.

    Args:
        `uint`: the input unsigned integer
        `width`: The width of each individual unsigned integer.
        `size`: The number of items in the produced list.

    >>> uint_to_list_of_uints(5, size=4, width=1)
    [1, 0, 1, 0]
    >>> uint_to_list_of_uints(27, size=3, width=2)
    [3, 2, 1]
    """
    if uint is None:
        output = [None] * size
    else:
        assert uint >= 0
        residual = uint
        f = pow(2, width)
        output = []
        for i in range(size):
            output.append(residual % f)
            residual = residual >> width
        assert residual == 0
    return output
