def timerange(self, t1, t2, inside=True, sort=None):
    'Infer edge timerange from graph structure\n\n        a -- ... -- [ t1 ] -- A -- ... -- B -- [ t2 ] -- ... -- b\n\n        ==> [a, b] (inside=False) or [A, B] (inside=True)\n\n        Parameters\n        ----------\n        t1, t2 : anchored or drifting times\n        inside : boolean, optional\n\n        Returns\n        -------\n        segment : Segment\n        '
    t1 = T(t1)
    t2 = T(t2)
    if (sort is None):
        sort = self.temporal_sort()
    if t1.anchored:
        start = t1
    else:
        start = None
        istart = sort.index(t1)
        search = (sort[(istart + 1):] if inside else sort[(istart - 1)::(- 1)])
        for t in search:
            if t.anchored:
                start = t
                break
        if (start is None):
            start = (TEnd if inside else TStart)
    if t2.anchored:
        end = t2
    else:
        end = None
        iend = sort.index(t2)
        search = (sort[(iend - 1)::(- 1)] if inside else sort[(iend + 1):])
        for t in search:
            if t.anchored:
                end = t
                break
        if (end is None):
            end = (TStart if inside else TEnd)
    return Segment(start=start, end=end)
Infer edge timerange from graph structure

a -- ... -- [ t1 ] -- A -- ... -- B -- [ t2 ] -- ... -- b

==> [a, b] (inside=False) or [A, B] (inside=True)

Parameters
----------
t1, t2 : anchored or drifting times
inside : boolean, optional

Returns
-------
segment : Segment
def timerange(self, t1, t2, inside=True, sort=None):
    'Infer edge timerange from graph structure\n\n        a -- ... -- [ t1 ] -- A -- ... -- B -- [ t2 ] -- ... -- b\n\n        ==> [a, b] (inside=False) or [A, B] (inside=True)\n\n        Parameters\n        ----------\n        t1, t2 : anchored or drifting times\n        inside : boolean, optional\n\n        Returns\n        -------\n        segment : Segment\n        '
    t1 = T(t1)
    t2 = T(t2)
    if (sort is None):
        sort = self.temporal_sort()
    if t1.anchored:
        start = t1
    else:
        start = None
        istart = sort.index(t1)
        search = (sort[(istart + 1):] if inside else sort[(istart - 1)::(- 1)])
        for t in search:
            if t.anchored:
                start = t
                break
        if (start is None):
            start = (TEnd if inside else TStart)
    if t2.anchored:
        end = t2
    else:
        end = None
        iend = sort.index(t2)
        search = (sort[(iend - 1)::(- 1)] if inside else sort[(iend + 1):])
        for t in search:
            if t.anchored:
                end = t
                break
        if (end is None):
            end = (TStart if inside else TEnd)
    return Segment(start=start, end=end)