def recordtree(table, start='start', stop='stop'):
    """
    Construct an interval tree for the given table, where each node in the
    tree is a row of the table represented as a record object.

    """

    import intervaltree
    getstart = attrgetter(start)
    getstop = attrgetter(stop)
    tree = intervaltree.IntervalTree()
    for rec in records(table):
        tree.addi(getstart(rec), getstop(rec), rec)
    return tree
def recordtree ( table , start = 'start' , stop = 'stop' ) : import intervaltree getstart = attrgetter ( start ) getstop = attrgetter ( stop ) tree = intervaltree . IntervalTree ( ) for rec in records ( table ) : tree . addi ( getstart ( rec ) , getstop ( rec ) , rec ) return tree
Construct an interval tree for the given table, where each node in the
    tree is a row of the table represented as a record object.