def METHOD_NAME(self, index, width, height):
    '''
    Test if region (width,height) fit into self.nodes[index]
    Parameters
    ----------
    index : int
        Index of the internal node to be tested
    width : int
        Width or the region to be tested
    height : int
        Height or the region to be tested
    '''
    node = self.nodes[index]
    x, y = node[0], node[1]
    width_left = width
    if x + width > self.width:
        return -1
    i = index
    while width_left > 0:
        node = self.nodes[i]
        y = max(y, node[1])
        if y + height > self.height:
            return -1
        width_left -= node[2]
        i += 1
    return y