docs: def stop(self):
          """Stops the instance.
  
          :raises RuntimeError: has not been started.
          :raises TypeError: :meth:`run` is not canonical.
  
          """
          if not self.is_running():
              raise RuntimeError('Not started')
          running, self._running = self._running, None
          try:
              next(running)
          except StopIteration:
              # expected.
              pass
          else:
              raise TypeError('run() must yield just one time')