code: def _set_factory_context(factory_class, bundle_context):
      # type: (type, Optional[BundleContext]) -> Optional[FactoryContext]
      
      try:
          # Try to get the factory context (built using decorators)
          context = getattr(factory_class, constants.IPOPO_FACTORY_CONTEXT)
      except AttributeError:
          # The class has not been manipulated, or too badly
          return None
  
      if not context.completed:
          # Partial context (class not manipulated)
          return None
  
      # Associate the factory to the bundle context
      context.set_bundle_context(bundle_context)
      return context
docs: Transforms the context data dictionary into its FactoryContext object form.
  
      :param factory_class: A manipulated class
      :param bundle_context: The class bundle context
      :return: The factory context, None on error