<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set(cls, var_name: str, value: Any) -> 'Configuration': """ Set the variable :param var_name: Variable name :param value: Value of variable :return: :class:`~haps.config.Configuration` instance for easy\ chaining """

        with cls._lock:
            if var_name not in cls().cache:
                cls().cache[var_name] = value
            else:
                raise ConfigurationError(
                    f'Value for {var_name} already set')
        return cls()