code: def rename_pipe(self, old_name, new_name):
          
          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])
docs: Rename a pipeline component.
  
          old_name (unicode): Name of the component to rename.
          new_name (unicode): New name of the component.
  
          DOCS: https://spacy.io/api/language#rename_pipe