code: def reset(self, **kwargs):
          
  
          self.agenda = Agenda()
          self.facts = FactList()
  
          self.matcher.reset()
  
          deffacts = []
          for deffact in self.get_deffacts():
              signature = inspect.signature(deffact)
              if not any(p.kind == inspect.Parameter.VAR_KEYWORD
                         for p in signature.parameters.values()):
                  # There is not **kwargs defined. Pass only the defined
                  # names.
                  args = set(signature.parameters.keys())
                  deffacts.append(
                      deffact(**{k: v for k, v in kwargs.items()
                                 if k in args}))
              else:
                  deffacts.append(deffact(**kwargs))
  
          # Declare all facts yielded by deffacts
          self.__declare(*chain.from_iterable(deffacts))
  
          self.running = False
docs: Performs a reset as per CLIPS behaviour (resets the
          agenda and factlist and declares InitialFact())
  
          Any keyword argument passed to `reset` will be passed to @DefFacts
          which have those arguments on their signature.
  
          .. note:: If persistent facts have been added, they'll be
                    re-declared.