<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_variable(self, key):
 """Deletes a global variable :param key: the key of the global variable to be deleted :raises exceptions.AttributeError: if the global variable does not exist """

        key = str(key)
        if self.is_locked(key):
            raise RuntimeError("Global variable is locked")

        with self.__global_lock:
            if key in self.__global_variable_dictionary:
                access_key = self.lock_variable(key, block=True)
                del self.__global_variable_dictionary[key]
                self.unlock_variable(key, access_key)
                del self.__variable_locks[key]
                del self.__variable_references[key]
            else:
                raise AttributeError("Global variable %s does not exist!" % str(key))

        logger.debug("Global variable %s was deleted!" % str(key))