code: def getbranches(tree):
      """
      walk tree to get list of branches
  
      Parameters
      ----------
      tree : list of tuples
          tree as defined for RU2NMNL
  
      Returns
      -------
      branch : list
          list of all branch names
  
      """
      if isinstance(tree, tuple):
          name, subtree = tree
          a = [name]
          for st in subtree:
              a.extend(getbranches(st))
          return a
      return []
  
file_path: statsmodels/statsmodels/sandbox/regression/treewalkerclass.py
imports: from statsmodels.compat.python import lrange
  from pprint import pprint
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: getbranches(tree) and returns: list, a