def METHOD_NAME(
    self, image:bytearray, base_offset:int, value:int, index:list, cur_dim:int=0):
    if(len(index) == 0):
        raise ArgumentError("Expected index")
    if(index[0] >= self._dim):
        vprint("index (%d) at dimension %d, is out of range (%d)"
                %(index[0], cur_dim, self._dim))
        raise ArgumentError("Index(%d) out of range(%d)" % (index[0],self._dim))
    base_offset = base_offset + index[0] * self._base.size
    if(isinstance(self._base, ArrayValueType)):
        return self._base.METHOD_NAME(
            image, base_offset, value, index[1:], cur_dim + 1)
    else:
        # this the 0th dimension
        assert (len(index) == 1), "more dimension than expected"
        return self.set_element(image, base_offset, value)