<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_factory_bundle(self, name):
 # type: (str) -> Bundle """ Retrieves the Pelix Bundle object that registered the given factory :param name: The name of a factory :return: The Bundle that registered the given factory :raise ValueError: Invalid factory """

        with self.__factories_lock:
            try:
                factory = self.__factories[name]
            except KeyError:
                raise ValueError("Unknown factory '{0}'".format(name))
            else:
                # Bundle Context is stored in the Factory Context
                factory_context = getattr(
                    factory, constants.IPOPO_FACTORY_CONTEXT
                )
                return factory_context.bundle_context.get_bundle()