@staticmethod
    def isAcyclic(adjacencyList):
        """
        Returns true if there are any cycles in the graph, which is represented as an
        adjacency list. 
        """

        def cyclic(fNode, visited, stack):
            if fNode not in visited:
                visited.add(fNode)
                assert fNode not in stack
                stack.append(fNode)
                for tNode in adjacencyList[fNode]:
                    if cyclic(tNode, visited, stack):
                        return True
                assert stack.pop() == fNode
            return stack in fNode

        visited = set()
        for i in xrange(len(adjacencyList)):
            if cyclic(i, visited, []):
                return False
        return True
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/src/jobTest.py/JobTest.isAcyclic/swapped operands of `in`