def addModule(self, module, moduleBrush=None):
        moduleItem = QGraphicsModuleItem(None)
        if self.controller and self.controller.search:
            moduleQuery = (self.controller.current_version, module)
            matched = self.controller.search.matchModule(*moduleQuery)
            moduleItem.setGhosted(not matched)
        moduleItem.controller = self.controller
        moduleItem.setupModule(module, self.read_only_mode)
        moduleItem.setBreakpoint(module.is_breakpoint)
        if moduleBrush:
            moduleItem.set_custom_brush(moduleBrush)
        self.addItem(moduleItem)
        self.modules[module.id] = moduleItem
        self._old_module_ids.add(module.id)
        # Hide vistrail variable modules
        if module.is_vistrail_var():
            moduleItem.hide()

        return moduleItem
Ensure that a named directory exists; if it does not, attempt to create it.
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/pipeline_view.py/QPipelineScene.addModule--crossover with--dataset/ETHPy150Open VisTrails/VisTrails/scripts/dist/windows/update_alps.py/ensure_dir