def isClique(cnds, node, tb, te, as_link, times):
    """ returns True if X(c) union node is a clique over tb;te, False otherwise"""
    for i in cnds:
        if as_link(i, node) not in times:
            return False
        else:
            link = as_link(i, node)
            tlist = times[link]
            first, last = 0, len(tlist) - 1
            middle = (first + last) // 2
            while first <= last:
                if tlist[middle][0] > tb:
                    last = middle - 1
                elif tlist[middle][1] < tb:
                    first = middle + 1
                else:
                    assert tlist[middle][0] <= tb and tlist[middle][1] >= tb
                    if tlist[middle][1] < te:
                        return False
                    break
                middle = (first + last) // 2
            if first > last:
                return False
    return True
