def rename_pipe(self, old_name, new_name):
if old_name not in self.pipe_names:<EOL><INDENT>raise ValueError(Errors.E001.format(name=old_name, opts=self.pipe_names))<EOL><DEDENT>if new_name in self.pipe_names:<EOL><INDENT>raise ValueError(Errors.E007.format(name=new_name, opts=self.pipe_names))<EOL><DEDENT>i = self.pipe_names.index(old_name)<EOL>self.pipeline[i] = (new_name, self.pipeline[i][<NUM_LIT:1>])<EOL>
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