code: def get_alignak_class(python_path):
      
      a_module, a_class = python_path.rsplit('.', 1)
  
      if not a_module.startswith('alignak'):  # pragma: no cover - should never happen!
          raise AlignakClassLookupException("Can't recreate object in module: %s. "
                                            "Not an Alignak module" % a_module)
  
      if a_module not in sys.modules:  # pragma: no cover - should never happen!
          raise AlignakClassLookupException("Can't recreate object in unknown module: %s. "
                                            "No such Alignak module. Alignak versions may mismatch" %
                                            a_module)
  
      pymodule = sys.modules[a_module]
  
      if not hasattr(pymodule, a_class):  # pragma: no cover - should never happen!
          raise AlignakClassLookupException("Can't recreate object %s in %s module. "
                                            "Module does not have this attribute. "
                                            "Alignak versions may mismatch" % (a_class, a_module))
  
      # Awful hack for external commands ... need to be refactored!
      if a_class not in ['ExternalCommand']:
          if not isinstance(getattr(pymodule, a_class), type):  # pragma: no cover - protection
              raise AlignakClassLookupException("Can't recreate object %s in %s module. "
                                                "This type is not a class" % (a_class, a_module))
  
      return getattr(pymodule, a_class)
docs: Get the alignak class the in safest way I could imagine.
      Return None if (cumulative conditions) ::
  
      * the module does not start with alignak
      * above is false and the module is not is sys.modules
      * above is false and the module does not have the wanted class
      * above is false and the class in not a ClassType
  
      :param python_path:
      :type python_path: str
      :return: alignak class
      :raise AlignakClassLookupException