def register(self, property, factory, *factory_args, **factory_kw):
        """Registers factory for the given property name.
        The factory could be a callable or a raw value.
        Arguments of the factory will be searched
        inside the context by their name.

        The factory_args and factory_kw allow
        to specify extra arguments for the factory.
        """
        if (factory_args or factory_kw) and not callable(factory):
            raise ValueError(
                    "Only callable factory supports extra args: %s, %s(%s, %s)"
                    % (property, factory, factory_args, factory_kw))

        self.factories[property] = factory, factory_args, factory_kw
Registers factory for the given property name.
        The factory could be a callable or a raw value.
        Arguments of the factory will be searched
        inside the context by their name.

        The factory_args and factory_kw allow
        to specify extra arguments for the factory.
        
recipes/Python/576609_Noninvasive_Dependency_Injection/recipe-576609.py