code: def vtree(vname):
      r"""Get all of the antecedent variables.
  
      Before applying a variable to a dataframe, we have to recursively
      get all of the child variables, beginning with the starting variable's
      expression. Then, we have to extract the variables from all the
      subsequent expressions. This process continues until all antecedent
      variables are obtained.
  
      Parameters
      ----------
      vname : str
          A valid variable stored in ``Variable.variables``.
  
      Returns
      -------
      all_variables : list
          The variables that need to be applied before ``vname``.
  
      Other Parameters
      ----------------
      Variable.variables : dict
          Global dictionary of variables
  
      """
      allv = []
  
      def vwalk(allv, vname):
          vxlag, root, plist, lag = vparse(vname)
          if root in Variable.variables:
              root_expr = Variable.variables[root].expr
              expr = vsub(vname, root_expr)
              av = allvars(expr)
              for v in av:
                  vwalk(allv, v)
          else:
              for p in plist:
                  if valid_name(p):
                      vwalk(allv, p)
          allv.append(vname)
          return allv
  
      allv = vwalk(allv, vname)
      all_variables = list(OrderedDict.fromkeys(allv))
      return all_variables
  
imports: from alphapy.alias import get_alias
  from alphapy.frame import Frame
  from alphapy.frame import frame_name
  from alphapy.globals import BSEP, LOFF, ROFF, USEP
  from alphapy.utilities import valid_name
  import builtins
  from collections import OrderedDict
  from importlib import import_module
  import logging
  import numpy
  import pandas
  import parser
  import re
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: vtree(vname) and returns: all_variables, allv