code: def copy(self, inheritance=False):
          # type: (bool) -> FactoryContext
          
          # Create a new factory context and duplicate its values
          new_context = FactoryContext()
          for field in self.__slots__:
              if not field.startswith("_"):
                  setattr(
                      new_context, field, self._deepcopy(getattr(self, field))
                  )
  
          if inheritance:
              # Store configuration as inherited one
              new_context.__inherited_configuration = self.__handlers.copy()
              new_context.__handlers = {}
  
          # Remove instances in any case
          new_context.__instances.clear()
          new_context.is_singleton_active = False
          return new_context
docs: Returns a deep copy of the current FactoryContext instance
  
          :param inheritance: If True, current handlers configurations are stored
                              as inherited ones