def relabel_drifting_nodes(self, mapping=None):
    'Relabel drifting nodes\n\n        Parameters\n        ----------\n        mapping : dict, optional\n            A dictionary with the old labels as keys and new labels as values.\n\n        Returns\n        -------\n        g : Transcription\n            New annotation graph\n        mapping : dict\n            A dictionary with the new labels as keys and old labels as values.\n            Can be used to get back to the version before relabelling.\n        '
    if (mapping is None):
        old2new = {n: T() for n in self.drifting()}
    else:
        old2new = dict(mapping)
    new2old = {new: old for (old, new) in old2new.iteritems()}
    return (nx.relabel_nodes(self, old2new, copy=True), new2old)
Relabel drifting nodes

Parameters
----------
mapping : dict, optional
    A dictionary with the old labels as keys and new labels as values.

Returns
-------
g : Transcription
    New annotation graph
mapping : dict
    A dictionary with the new labels as keys and old labels as values.
    Can be used to get back to the version before relabelling.
def relabel_drifting_nodes(self, mapping=None):
    'Relabel drifting nodes\n\n        Parameters\n        ----------\n        mapping : dict, optional\n            A dictionary with the old labels as keys and new labels as values.\n\n        Returns\n        -------\n        g : Transcription\n            New annotation graph\n        mapping : dict\n            A dictionary with the new labels as keys and old labels as values.\n            Can be used to get back to the version before relabelling.\n        '
    if (mapping is None):
        old2new = {n: T() for n in self.drifting()}
    else:
        old2new = dict(mapping)
    new2old = {new: old for (old, new) in old2new.iteritems()}
    return (nx.relabel_nodes(self, old2new, copy=True), new2old)