code: def set(self, namespace, key, value, description=None):
          
  
          if isinstance(value, DBCChoice):
              vtype = 'choice'
  
          elif isinstance(value, DBCString):
              vtype = 'string'
  
          elif isinstance(value, DBCFloat):
              vtype = 'float'
  
          elif isinstance(value, DBCInt):
              vtype = 'int'
  
          elif isinstance(value, DBCArray):
              vtype = 'array'
  
          elif isinstance(value, DBCJSON):
              vtype = 'json'
  
          elif isinstance(value, bool):
              vtype = 'bool'
  
          else:
              raise ValueError('Invalid config item type: {}'.format(type(value)))
  
          if namespace in self.__data and key in self.__data[namespace]:
              itm = db.ConfigItem.find_one(
                  ConfigItem.namespace_prefix == namespace,
                  ConfigItem.key == key
              )
  
              if not itm:
                  raise KeyError(key)
  
              itm.value = value
              itm.type = vtype
              if description:
                  itm.description = description
          else:
              itm = ConfigItem()
              itm.key = key
              itm.value = value
              itm.type = vtype
              itm.description = description
              itm.namespace_prefix = namespace
  
          db.session.add(itm)
          db.session.commit()
  
          if namespace in self.__data:
              self.__data[namespace][key] = value
          else:
              self.__data[namespace] = {key: value}
docs: Set (create/update) a configuration item
  
          Args:
              namespace (`str`): Namespace for the item
              key (`str`): Key of the item
              value (`Any`): Value of the type, must by one of `DBCString`, `DBCFloat`, `DBCInt`, `DBCArray`, `DBCJSON` or
              `bool`
              description (`str`): Description of the configuration item
  
          Returns:
              `None`