def METHOD_NAME(self, data: TScopeWidget):
    """
    Gets the widget name and object from the given data
    Add widget to a dock and adds dock to this tab's dock area
    And to this tab's map of widgets and docks
    :param data: the data describing the widget of type TScopeWidget
    """
    widget_name = data.name
    new_widget = data.widget
    self.widgets_map[widget_name] = new_widget
    new_dock = Dock(widget_name)
    new_dock.addWidget(new_widget.win if data.in_window else new_widget)
    self.dock_map[widget_name] = new_dock
    if data.stretch:
        stretch_data = data.stretch
        if stretch_data.y:
            new_dock.setStretch(y=stretch_data.y)
        if stretch_data.x:
            new_dock.setStretch(x=stretch_data.x)
    if data.anchor and data.position:
        self.dock_area.addDock(new_dock, data.position, self.dock_map[data.anchor])
    else:
        self.dock_area.addDock(new_dock)
    if data.has_refresh_func:
        self.refresh_functions[widget_name] = new_widget.refresh