def _create_window(self):
        """ Create the WorkbenchWindow object for the workbench.

        This will load the highest ranking extension to the window
        factory extension point, and use it to create the instance.

        """
        workbench = self.workbench
        point = workbench.get_extension_point(WINDOW_FACTORY_POINT)
        extensions = point.extensions
        if not extensions:
            msg = "no contributions to the '%s' extension point"
            raise RuntimeError(msg % WINDOW_FACTORY_POINT)

        extension = extensions[-1]
        if extension.factory is None:
            msg = "extension '%s' does not declare a window factory"
            raise ValueError(extension.qualified_id % msg)

        window = extension.factory(workbench)
        if not isinstance(window, WorkbenchWindow):
            msg = "extension '%s' created non-WorkbenchWindow type '%s'"
            args = (extension.qualified_id, type(window).__name__)
            raise TypeError(msg % args)

        window.workbench = workbench
        window.window_model = self._model
        self._window = window
dataset/ETHPy150Open nucleic/enaml/enaml/workbench/ui/ui_plugin.py/UIPlugin._create_window/swapped operands of `%`