class_docstr: A class to maintain the state during planarity check.
class_docstr_tok: ["A","class","to","maintain","the","state","during","planarity","check","."]
docstr: Test for LR partition.
docstr_tok: ["Test","for","LR","partition","."]
code: def dfs_testing(self, v):
      """Test for LR partition."""
      # the recursion stack
      dfs_stack = [v]
      # index of next edge to handle in adjacency list of each node
      ind = defaultdict(lambda: 0)
      # boolean to indicate whether to skip the initial work for an edge
      skip_init = defaultdict(lambda: False)
  
      while dfs_stack:
          v = dfs_stack.pop()
          e = self.parent_edge[v]
          # to indicate whether to skip the final block after the for loop
          skip_final = False
  
          for w in self.ordered_adjs[v][ind[v] :]:
              ei = (v, w)
  
              if not skip_init[ei]:
                  self.stack_bottom[ei] = top_of_stack(self.S)
  
                  if ei == self.parent_edge[w]:  # tree edge
                      dfs_stack.append(v)  # revisit v after finishing w
                      dfs_stack.append(w)  # visit w next
                      skip_init[ei] = True  # don't redo this block
                      skip_final = (
                          True  # skip final work after breaking
                      )
                      break  # handle next node in dfs_stack (i.e. w)
                  else:  # back edge
                      self.lowpt_edge[ei] = ei
                      self.S.append(
                          ConflictPair(right=Interval(ei, ei))
                      )
  
              # integrate new return edges
              if self.lowpt[ei] < self.height[v]:
                  if (
                      w == self.ordered_adjs[v][0]
                  ):  # e_i has return edge
                      self.lowpt_edge[e] = self.lowpt_edge[ei]
                  else:  # add constraints of e_i
                      if not self.add_constraints(ei, e):
                          # graph is not planar
                          return False
  
              ind[v] += 1
  
          if not skip_final:
              # remove back edges returning to parent
              if e is not None:  # v isn't root
                  self.remove_back_edges(e)
  
      return True
  
imports: from collections import defaultdict
  import networkx
label_desc: Use image node_id 6 for calling the LRPlanarity obj's underlying member method code with example usage: obj.dfs_testing(v) and returns: True, False