          self.restore()
  
      def restore(self) -> None:
          """Restore the pipeline to its state when DisabledPipes was created."""
          current, self.nlp.pipeline = self.nlp.pipeline, self.original_pipeline
          unexpected = [name for name, pipe in current if not self.nlp.has_pipe(name)]
          if unexpected:
              # Don't change the pipeline if we're raising an error.
              self.nlp.pipeline = current
              raise ValueError(Errors.E008.format(names=unexpected))
          self.nlp._pipe_meta.update(self.metas)
          self.nlp._pipe_configs.update(self.configs)
          self[:] = []
  
  
  def _pipe(
      examples: Iterable[Example], proc: Callable[[Doc], Doc], kwargs: Dict[str, Any]
 
</s> remove         self.pipeline = []
 </s> add         self._pipeline = []
        self._disabled = set() </s> remove         if name in self.pipe_names:
            raise ValueError(Errors.E007.format(name=name, opts=self.pipe_names))
 </s> add         if name in self._pipe_names:
            raise ValueError(Errors.E007.format(name=name, opts=self._pipe_names)) </s> remove         if old_name not in self.pipe_names:
            raise ValueError(Errors.E001.format(name=old_name, opts=self.pipe_names))
        if new_name in self.pipe_names:
            raise ValueError(Errors.E007.format(name=new_name, opts=self.pipe_names))
        i = self.pipe_names.index(old_name)
        self.pipeline[i] = (new_name, self.pipeline[i][1])
 </s> add         if old_name not in self._pipe_names:
            raise ValueError(Errors.E001.format(name=old_name, opts=self._pipe_names))
        if new_name in self._pipe_names:
            raise ValueError(Errors.E007.format(name=new_name, opts=self._pipe_names))
        i = self._pipe_names.index(old_name)
        self._pipeline[i] = (new_name, self._pipeline[i][1]) </s> remove         for pipe_name in self.pipe_names:
 </s> add         for pipe_name in self._pipe_names: </s> remove         for name, pipe in self.pipeline:
 </s> add         for name, pipe in self._pipeline:
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
          self.restore()
  
      def restore(self) -> None:
          """Restore the pipeline to its state when DisabledPipes was created."""
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
        for name in self.names:
            self.nlp.enable_pipe(name)
        # TODO: maybe add some more checks / catch errors that may occur if
        # user removes a disabled pipe in the with block
          self[:] = []
  
  
  def _pipe(
      examples: Iterable[Example], proc: Callable[[Doc], Doc], kwargs: Dict[str, Any]
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Allow loaded but disabled components 
spacy/language.py