def METHOD_NAME(self, width, height):
    '''
    Get a free region of given size and allocate it
    Parameters
    ----------
    width : int
        Width of region to allocate
    height : int
        Height of region to allocate
    Return
    ------
        A newly allocated region as (x,y,width,height) or (-1,-1,0,0)
    '''
    best_height = sys.maxsize
    best_index = -1
    best_width = sys.maxsize
    region = 0, 0, width, height
    for i in range(len(self.nodes)):
        y = self.fit(i, width, height)
        if y >= 0:
            node = self.nodes[i]
            if (y + height < best_height or
                    (y + height == best_height and node[2] < best_width)):
                best_height = y + height
                best_index = i
                best_width = node[2]
                region = node[0], y, width, height
    if best_index == -1:
        return -1, -1, 0, 0
    node = region[0], region[1] + height, width
    self.nodes.insert(best_index, node)
    i = best_index + 1
    while i < len(self.nodes):
        node = self.nodes[i]
        prev_node = self.nodes[i - 1]
        if node[0] < prev_node[0] + prev_node[2]:
            shrink = prev_node[0] + prev_node[2] - node[0]
            x, y, w = self.nodes[i]
            self.nodes[i] = x + shrink, y, w - shrink
            if self.nodes[i][2] <= 0:
                del self.nodes[i]
                i -= 1
            else:
                break
        else:
            break
        i += 1
    self.max_y = region[1] + region[3]
    self.merge()
    self.used += width * height
    return region