code: def register_factory(self, bundle_context, factory):
          # type: (BundleContext, type) -> bool
          
          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
docs: 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)