# Path: sourceutils/csvASTs/CSVRowAccessors.py
# def getCSVRowCondition(row):
#     return row[CONDITION]


from sourceutils.csvASTs.CSVRowAccessors import getCSVRowCondition


class CFG:
    def __init__(self):
        self.nodes = list() # list of basic blocks
        self.edges = list() # (src,dst)-pairs
        self.labeledNodes = list() # list of (id, row) pairs
    
    # returns the ID
    def addNode(self, s):
        self.nodes.append(s)
        return len(self.nodes) - 1

    def addEdge(self, src, dst, predicate = None):
        self.edges.append((src, dst, predicate))

    def removeEdgesFrom(self, src):
        for i in xrange(len(self.edges)):
            if self.edges[i][0] == src:
                del self.edges[i]
                return
    
    def removeEdge(self, src, dst):
        

# Path: sourceutils/csvASTs/CSVRowAccessors.py
# def getCSVRowCondition(row):
#     return row[CONDITION]


# Path: sourceutils/pythonCFGs/CFG.py
from sourceutils.csvASTs.CSVRowAccessors import getCSVRowCondition



class CFG:
    def __init__(self):
        self.nodes = list() # list of basic blocks
        self.edges = list() # (src,dst)-pairs
        self.labeledNodes = list() # list of (id, row) pairs
    
    # returns the ID
    def addNode(self, s):
        self.nodes.append(s)
        return len(self.nodes) - 1

    def addEdge(self, src, dst, predicate = None):
        self.edges.append((src, dst, predicate))

    def removeEdgesFrom(self, src):
        for i in xrange(len(self.edges)):
            if self.edges[i][0] == src:
                del self.edges[i]
                return
    
    def removeEdge(self, src, dst):
        

        for i in xrange(len(self.edges)):