Registers a factory function for creating the class
        :argument key name under which the dependencies will be
        registered
        :argument factory a function that receives the constructor as first
        argument and is used to create the class
        :argument shared if True, the factory result will be saved for reuse.
        This means that the same instance will be returned once the same key
        is requested again. If False requesting the same key will always return
        a new instance. Autoresolved classes will always be shared

def register(self, key: Any, factory: Callable[['Container'], Any],
                 shared: bool = True) -> None:
        """
        Registers a factory function for creating the class
        :argument key name under which the dependencies will be
        registered
        :argument factory a function that receives the constructor as first
        argument and is used to create the class
        :argument shared if True, the factory result will be saved for reuse.
        This means that the same instance will be returned once the same key
        is requested again. If False requesting the same key will always return
        a new instance. Autoresolved classes will always be shared
        """
        if shared:
            self._factories[key] = SingletonFactory(factory)
        else:
            self._factories[key] = Factory(factory)