def set(self, key: str, value: object) -> None:
        """
        Caches a value for the lifetime of the current turn.
        :param key:
        :param value:
        :return:
        """
        if not key or not isinstance(key, str):
            raise KeyError('"key" must be a valid string.')

        self._services[key] = value
def set(self, key: str, value: object) -> None:
        """
        Caches a value for the lifetime of the current turn.
        :param key:
        :param value:
        :return:
        """
        if not key or not isinstance(key, str):
            raise KeyError('"key" must be a valid string.')

        self._services[key] = value
def set ( self , key : str , value : object ) -> None : if not key or not isinstance ( key , str ) : raise KeyError ( '"key" must be a valid string.' ) self . _services [ key ] = value
Caches a value for the lifetime of the current turn.
        :param key:
        :param value:
        :return:
Caches a value for the lifetime of the current turn . : param key : : param value : : return :