def METHOD_NAME(self, page, text):
    """Decides whether sets title to MapNotebook page
    or an undocked independent frame"""
    if page.IsDocked():
        self.SetPageText(page_idx=self.GetPageIndex(page), text=text)
    else:
        frame = page.GetParent()
        frame.SetTitle(text)
        wx.CallLater(500, frame.Raise)