code: def create_window(self, pane, name=None, set_active=True):
          
          assert isinstance(pane, Pane)
          assert name is None or isinstance(name, six.text_type)
  
          # Take the first available index.
          taken_indexes = [w.index for w in self.windows]
  
          index = self.base_index
          while index in taken_indexes:
              index += 1
  
          # Create new window and add it.
          w = Window(index)
          w.add_pane(pane)
          self.windows.append(w)
  
          # Sort windows by index.
          self.windows = sorted(self.windows, key=lambda w: w.index)
  
          app = get_app(return_none=True)
  
          if app is not None and set_active:
              self.set_active_window(w)
  
          if name is not None:
              w.chosen_name = name
  
          assert w.active_pane == pane
          assert w._get_parent(pane)
docs: Create a new window that contains just this pane.
  
          :param pane: The :class:`.Pane` instance to put in the new window.
          :param name: If given, name for the new window.
          :param set_active: When True, focus the new window.