def _looppath(self, src, node, visited, cnt=0):
        paths = set([])
        if cnt > 50:
            return paths
        if src == node:
            paths.add( (src,) )
            return paths
        if not node in self.fsm:
            return paths
        nextnodes = set(self.fsm[node].values()) - visited
        for n in nextnodes:
            r = self._looppath(src, n, visited=visited|set([node]), cnt=cnt+1)
            if len(r) > 0:
                for np in r: paths.add( (node,) + np )
        return paths
dataset/ETHPy150Open PyHDI/Pyverilog/pyverilog/controlflow/controlflow_analyzer.py/FiniteStateMachine._looppath/original