code: def from_digraph(self, digraph):
          
  
          for n1 in digraph.nodes():
              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:
                      # There is a control flow transition from block `addr1` to block `addr2`
                      self.add_exit_to_whitelist(addr1, addr2)
  
                  self.add_statements_to_whitelist(addr2, (stmt_idx2,))
docs: 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 networkx.DiGraph digraph: A networkx.DiGraph object