docstr: Reconstructs the original graph from a dedensified, directed graph
  
  Parameters
  ----------
  G: dedensified graph
     A networkx graph
  compressor_nodes: iterable
     Iterable of compressor nodes in the dedensified graph
  inplace: bool, optional (default: False)
     Indicates if densification should be done inplace
  
  Returns
  -------
  G: graph
     A densified networkx graph
docstr_tok: ["Reconstructs","the","original","graph","from","a","dedensified",",","directed","graph","Parameters","--","--","--","--","--","G",":","dedensified","graph","A","networkx","graph","compressor_nodes",":","iterable","Iterable","of","compressor","nodes","in","the","dedensified","graph","inplace",":","bool",",","optional","(","default",":","False",")","Indicates","if","densification","should","be","done","inplace","Returns","--","--","--","-","G",":","graph","A","densified","networkx","graph"]
code: def densify(G, compressor_nodes, copy=True):
      """
      Reconstructs the original graph from a dedensified, directed graph
  
      Parameters
      ----------
      G: dedensified graph
         A networkx graph
      compressor_nodes: iterable
         Iterable of compressor nodes in the dedensified graph
      inplace: bool, optional (default: False)
         Indicates if densification should be done inplace
  
      Returns
      -------
      G: graph
         A densified networkx graph
      """
      if copy:
          G = G.copy()
      for compressor_node in compressor_nodes:
          all_neighbors = set(nx.all_neighbors(G, compressor_node))
          out_neighbors = set(G.neighbors(compressor_node))
          for out_neighbor in out_neighbors:
              G.remove_edge(compressor_node, out_neighbor)
          in_neighbors = all_neighbors - out_neighbors
          for in_neighbor in in_neighbors:
              G.remove_edge(in_neighbor, compressor_node)
              for out_neighbor in out_neighbors:
                  G.add_edge(in_neighbor, out_neighbor)
          G.remove_node(compressor_node)
      return G
  
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestDirectedDedensification obj's underlying member method code with example usage: obj.densify(G, compressor_nodes, copy) and returns: G