code: def _fake_createclass(self, namespace, **params):
          
          # Validate parameters
          new_class = params['NewClass']
          if not isinstance(new_class, CIMClass):
              raise CIMError(
                  CIM_ERR_INVALID_PARAMETER,
                  _format("NewClass not valid CIMClass. Rcvd type={0}",
                          type(new_class)))
  
          # Validate namespace
          class_repo = self._get_class_repo(namespace)
  
          qualifier_repo = None if self._repo_lite else \
              self._get_qualifier_repo(namespace)
  
          if new_class.classname in class_repo:
              raise CIMError(
                  CIM_ERR_ALREADY_EXISTS,
                  _format("Class {0!A} already exists in namespace {1!A}.",
                          new_class.classname, namespace))
  
          new_class = deepcopy(new_class)
  
          self._resolve_class(new_class, namespace, qualifier_repo, verbose=False)
  
          class_repo[new_class.classname] = new_class
docs: Implements a mock server responder for
          :meth:`~pywbem.WBEMConnection.CreateClass`
  
          Creates a new class in the repository.  Nothing is returned.
          Emulates WBEMConnection.CreateClass(...))
  
          If the class repository for this namespace does not
          exist, this method creates it.
  
          Classes that are in the repository contain only the properties in
          the new_class, not any properties from inheritated classes.  The
          corresponding _get_class resolves any inherited properties to create
          a complete class with both local and inherited properties.
  
          Raises:
              CIMError: CIM_ERR_INVALID_SUPERCLASS if superclass specified bu
                does not exist
  
              CIMError: CIM_ERR_INVALID_PARAMETER if NewClass parameter not a
                class
  
              CIMError: CIM_ERR_ALREADY_EXISTS if class already exists