def crop(self, source, target=None):
    'Get minimum subgraph between source time and target time\n\n        Parameters\n        ----------\n        source : Segment\n        target : float or str, optional\n\n        Returns\n        -------\n        g : Transcription\n            Sub-graph between source and target\n        '
    if isinstance(source, Segment):
        (source, target) = (source.start, source.end)
    source = T(source)
    target = T(target)
    if (source.anchored or target.anchored):
        anchored = sorted(self.anchored())
    if source.drifting:
        if (source not in self):
            raise ValueError(('Drifting time %s is not in the transcription.' % source))
        else:
            from_source = ({source} | nx.algorithms.descendants(self, source))
    elif (source in self):
        from_source = ({source} | nx.algorithms.descendants(self, source))
    elif (source < anchored[0]):
        from_source = set(self)
    else:
        before = [n for n in anchored if (n <= source)][(- 1)]
        from_source = ({before} | nx.algorithms.descendants(self, before))
    if target.drifting:
        if (target not in self):
            raise ValueError(('Drifting time %s is not in the transcription.' % target))
        else:
            to_target = ({target} | nx.algorithms.ancestors(self, target))
    elif (target in self):
        to_target = ({target} | nx.algorithms.ancestors(self, target))
    elif (target > anchored[(- 1)]):
        to_target = set(self)
    else:
        after = [n for n in anchored if (n >= target)][0]
        to_target = ({after} | nx.algorithms.ancestors(self, after))
    nbunch = (from_source & to_target)
    return self.subgraph(nbunch)
Get minimum subgraph between source time and target time

Parameters
----------
source : Segment
target : float or str, optional

Returns
-------
g : Transcription
    Sub-graph between source and target
def crop(self, source, target=None):
    'Get minimum subgraph between source time and target time\n\n        Parameters\n        ----------\n        source : Segment\n        target : float or str, optional\n\n        Returns\n        -------\n        g : Transcription\n            Sub-graph between source and target\n        '
    if isinstance(source, Segment):
        (source, target) = (source.start, source.end)
    source = T(source)
    target = T(target)
    if (source.anchored or target.anchored):
        anchored = sorted(self.anchored())
    if source.drifting:
        if (source not in self):
            raise ValueError(('Drifting time %s is not in the transcription.' % source))
        else:
            from_source = ({source} | nx.algorithms.descendants(self, source))
    elif (source in self):
        from_source = ({source} | nx.algorithms.descendants(self, source))
    elif (source < anchored[0]):
        from_source = set(self)
    else:
        before = [n for n in anchored if (n <= source)][(- 1)]
        from_source = ({before} | nx.algorithms.descendants(self, before))
    if target.drifting:
        if (target not in self):
            raise ValueError(('Drifting time %s is not in the transcription.' % target))
        else:
            to_target = ({target} | nx.algorithms.ancestors(self, target))
    elif (target in self):
        to_target = ({target} | nx.algorithms.ancestors(self, target))
    elif (target > anchored[(- 1)]):
        to_target = set(self)
    else:
        after = [n for n in anchored if (n >= target)][0]
        to_target = ({after} | nx.algorithms.ancestors(self, after))
    nbunch = (from_source & to_target)
    return self.subgraph(nbunch)