code: def import_plugin(self, plugin):
          '''
          Import plugin by given name, looking at :attr:`namespaces`.
  
          :param plugin: plugin module name
          :type plugin: str
          :raises PluginNotFoundError: if not found on any namespace
          '''
          names = [
              '%s%s%s' % (namespace, '' if namespace[-1] == '_' else '.', plugin)
              if namespace else
              plugin
              for namespace in self.namespaces
              ]
  
          for name in names:
              if name in sys.modules:
                  return sys.modules[name]
  
          for name in names:
              try:
                  __import__(name)
                  return sys.modules[name]
              except (ImportError, KeyError):
                  pass
  
          raise PluginNotFoundError(
              'No plugin module %r found, tried %r' % (plugin, names),
              plugin, namesf import_plugin(self, plugin):
          '''
          Import plugin by given name, looking at :attr:`namespaces`.
  
          :param plugin: plugin module name
          :type plugin: str
          :raises PluginNotFoundError: if not found on any namespace
          '''
          names = [
              '%s%s%s' % (namespace, '' if namespace[-1] == '_' else '.', plugin)
              if namespace else
              plugin
              for namespace in self.namespaces
              ]
  
          for name in names:
              if name in sys.modules:
                  return sys.modules[name]
  
          for name in names:
              try:
                  __import__(name)
                  return sys.modules[name]
              except (ImportError, KeyError):
                  pass
  
          raise PluginNotFoundError(
              'No plugin module %r found, tried %r' % (plugin, names),
              plugin, names)
docs: Import plugin by given name, looking at :attr:`namespaces`.
  
          :param plugin: plugin module name
          :type plugin: str
          :raises PluginNotFoundError: if not found on any namespace