<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_factory(self, bundle_context, factory):
 # type: (BundleContext, type) -> bool """ Registers a manually created factory, using decorators programmatically :param bundle_context: The factory bundle context :param factory: A manipulated class :return: True if the factory has been registered :raise ValueError: Invalid parameter, or factory already registered :raise TypeError: Invalid factory type (not a manipulated class) """

        if factory is None or bundle_context is None:
            # Invalid parameter, to nothing
            raise ValueError("Invalid parameter")

        context = _set_factory_context(factory, bundle_context)
        if not context:
            raise TypeError("Not a manipulated class (no context found)")

        self._register_factory(context.name, factory, False)
        return True