code: def expr_to_tree(ind, pset):
      """Convert the unstructured DEAP pipeline into a tree data-structure.
  
      Parameters
      ----------
      ind: deap.creator.Individual
         The pipeline that is being exported
  
      Returns
      -------
      pipeline_tree: list
         List of operators in the current optimized pipeline
  
      EXAMPLE:
          pipeline:
              "DecisionTreeClassifier(input_matrix, 28.0)"
          pipeline_tree:
              ['DecisionTreeClassifier', 'input_matrix', 28.0]
  
      """
  
      def prim_to_list(prim, args):
          if isinstance(prim, deap.gp.Terminal):
              if prim.name in pset.context:
                  return pset.context[prim.name]
              else:
                  return prim.value
  
          return [prim.name] + args
  
      tree = []
      stack = []
      for node in ind:
          stack.append((node, []))
          while len(stack[-1][1]) == stack[-1][0].arity:
              prim, args = stack.pop()
              tree = prim_to_list(prim, args)
              if len(stack) == 0:
                  break  # If stack is empty, all nodes should have been seen
              stack[-1][1].append(tree)
  
      return tree
  
file_path: tpot/tpot/export_utils.py
imports: import deap
label_desc: Use image node_id 3 for calling a global function with example usage: expr_to_tree(ind, pset) and returns: tree, unknown, pset, prim