<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self, namespace, key):
 """Remove a configuration item from the database Args: namespace (`str`):
 Namespace of the config item key (`str`):
 Key to delete Returns: `None` """

        if self.key_exists(namespace, key):
            obj = db.ConfigItem.find_one(
                ConfigItem.namespace_prefix == namespace,
                ConfigItem.key == key
            )

            del self.__data[namespace][key]

            db.session.delete(obj)
            db.session.commit()
        else:
            raise KeyError('{}/{}'.format(namespace, key))