'Initialize this AnnotatedCFG object with a networkx.DiGraph consisting of the following
form of nodes:
Tuples like (block address, statement ID)
Those nodes are connected by edges indicating the execution flow.
:param digraph: A networkx.DiGraph object'

def from_digraph(self, digraph):

    for n1 in digraph.nodes_iter():
        (addr1, stmt_idx1) = n1
        self.add_statements_to_whitelist(addr1, (stmt_idx1,))
        successors = digraph[n1]
        for n2 in successors:
            (addr2, stmt_idx2) = n2
            if (addr1 != addr2):
                self.add_exit_to_whitelist(addr1, addr2)
            self.add_statements_to_whitelist(addr2, (stmt_idx2,))
