class_docstr: A class to maintain the state during planarity check.
class_docstr_tok: ["A","class","to","maintain","the","state","during","planarity","check","."]
code: def __init__(self, G):
      # copy G without adding self-loops
      self.G = nx.Graph()
      self.G.add_nodes_from(G.nodes)
      for e in G.edges:
          if e[0] != e[1]:
              self.G.add_edge(e[0], e[1])
  
      self.roots = []
  
      # distance from tree root
      self.height = defaultdict(lambda: None)
  
      self.lowpt = {}  # height of lowest return point of an edge
      self.lowpt2 = {}  # height of second lowest return point
      self.nesting_depth = {}  # for nesting order
  
      # None -> missing edge
      self.parent_edge = defaultdict(lambda: None)
  
      # oriented DFS graph
      self.DG = nx.DiGraph()
      self.DG.add_nodes_from(G.nodes)
  
      self.adjs = {}
      self.ordered_adjs = {}
  
      self.ref = defaultdict(lambda: None)
      self.side = defaultdict(lambda: 1)
  
      # stack of conflict pairs
      self.S = []
      self.stack_bottom = {}
      self.lowpt_edge = {}
  
      self.left_ref = {}
      self.right_ref = {}
  
      self.embedding = PlanarEmbedding()
  
imports: from collections import defaultdict
  import networkx
label_desc: Use image node_id 1 to create a new LRPlanarity object  with example: obj = LRPlanarity(G)