class_docstr: A class to maintain the state during planarity check.
class_docstr_tok: ["A","class","to","maintain","the","state","during","planarity","check","."]
docstr: Completes the embedding.
docstr_tok: ["Completes","the","embedding","."]
code: def dfs_embedding(self, v):
      """Completes the embedding."""
      # the recursion stack
      dfs_stack = [v]
      # index of next edge to handle in adjacency list of each node
      ind = defaultdict(lambda: 0)
  
      while dfs_stack:
          v = dfs_stack.pop()
  
          for w in self.ordered_adjs[v][ind[v] :]:
              ind[v] += 1
              ei = (v, w)
  
              if ei == self.parent_edge[w]:  # tree edge
                  self.embedding.add_half_edge_first(w, v)
                  self.left_ref[v] = w
                  self.right_ref[v] = w
  
                  dfs_stack.append(v)  # revisit v after finishing w
                  dfs_stack.append(w)  # visit w next
                  break  # handle next node in dfs_stack (i.e. w)
              else:  # back edge
                  if self.side[ei] == 1:
                      self.embedding.add_half_edge(
                          w, v, ccw=self.right_ref[w]
                      )
                  else:
                      self.embedding.add_half_edge(
                          w, v, cw=self.left_ref[w]
                      )
                      self.left_ref[w] = v
  
imports: from collections import defaultdict
  import networkx
label_desc: Use image node_id 10 for calling the LRPlanarity obj's underlying member method code with example usage: obj.dfs_embedding(v) without return types