class_docstr: This class serves as an intermediate representation of the
  pattern tree during the conversion to sets of leaf-to-root
  subpatterns
class_docstr_tok: ["This","class","serves","as","an","intermediate","representation","of","the","pattern","tree","during","the","conversion","to","sets","of","leaf-to-root","subpatterns"]
docstr: Drives the leaf_to_root method. The reason that
  leaf_to_root must be run multiple times is because we need to
  reject 'group' matches; for example the alternative form
  (a | b c) creates a group [b c] that needs to be matched. Since
  matching multiple linear patterns overcomes the automaton's
  capabilities, leaf_to_root merges each group into a single
  choice based on 'characteristic'ity,
  
  i.e. (a|b c) -> (a|b) if b more characteristic than c
  
  Returns: The most 'characteristic'(as defined by
    get_characteristic_subpattern) path for the compiled pattern
    tree.
docstr_tok: ["Drives","the","leaf_to_root","method",".","The","reason","that","leaf_to_root","must","be","run","multiple","times","is","because","we","need","to","reject","'group","'","matches",";","for","example","the","alternative","form","(","a","|","b","c",")","creates","a","group","[","b","c","]","that","needs","to","be","matched",".","Since","matching","multiple","linear","patterns","overcomes","the","automaton's","capabilities",",","leaf_to_root","merges","each","group","into","a","single","choice","based","on","'characteristic'ity",",","i.e",".","(","a|b","c",")","-",">","(","a|b",")","if","b","more","characteristic","than","c","Returns",":","The","most","'characteristic","'","(","as","defined","by","get_characteristic_subpattern",")","path","for","the","compiled","pattern","tree","."]
code: def get_linear_subpattern(self):
      """Drives the leaf_to_root method. The reason that
      leaf_to_root must be run multiple times is because we need to
      reject 'group' matches; for example the alternative form
      (a | b c) creates a group [b c] that needs to be matched. Since
      matching multiple linear patterns overcomes the automaton's
      capabilities, leaf_to_root merges each group into a single
      choice based on 'characteristic'ity,
  
      i.e. (a|b c) -> (a|b) if b more characteristic than c
  
      Returns: The most 'characteristic'(as defined by
        get_characteristic_subpattern) path for the compiled pattern
        tree.
      """
  
      for l in self.leaves():
          subp = l.leaf_to_root()
          if subp:
              return subp
  
file_path: catboost/contrib/tools/python/src/Lib/lib2to3/btm_utils.py
imports: from .None import pytree
  from .pgen2 import grammar, token
  from .pygram import pattern_symbols, python_symbols
label_desc: Use image node_id 4 for calling the MinNode obj's underlying member method code with example usage: obj.get_linear_subpattern() and returns: subp