def METHOD_NAME(self):
    if self.dockWidget9IsNonDockable:
        numDockWidgets = 10
    else:
        numDockWidgets = 9
    # numDockWidgets = 2
    # Create 9 KDDockWidget::DockWidget and the respective widgets they're hosting (MyWidget instances)
    for _ in range(numDockWidgets):
        self.dockwidgets.append(self.newDockWidget())
    # MainWindow::addDockWidget() attaches a dock widget to the main window:
    initialOpts = KDDockWidgets.InitialOption(KDDockWidgets.InitialVisibilityOption.StartHidden,
                                              QtCore.QSize(500, 500))
    self.addDockWidget(self.dockwidgets[0], KDDockWidgets.Location_OnBottom, None, initialOpts)
    # Here, for finer granularity we specify right of dockwidgets[0]:
    self.addDockWidget(self.dockwidgets[1], KDDockWidgets.Location_OnRight, self.dockwidgets[0])
    self.addDockWidget(self.dockwidgets[2], KDDockWidgets.Location_OnLeft)
    self.addDockWidget(self.dockwidgets[3], KDDockWidgets.Location_OnBottom)
    self.addDockWidget(self.dockwidgets[4], KDDockWidgets.Location_OnBottom)
    # Tab two dock widgets together
    self.dockwidgets[3].addDockWidgetAsTab(self.dockwidgets[5])
    # 6 is floating, as it wasn't added to the main window via MainWindow::addDockWidget().
    # and we tab 7 with it.
    self.dockwidgets[6].addDockWidgetAsTab(self.dockwidgets[7])
    # Floating windows also support nesting, here we add 8 to the bottom of the group
    self.dockwidgets[6].addDockWidgetToContainingWindow(self.dockwidgets[8], KDDockWidgets.Location_OnBottom)
    floatingWindow = self.dockwidgets[6].window()
    floatingWindow.move(100, 100)