code: def vparse(vname):
      r"""Parse a variable name into its respective components.
  
      Parameters
      ----------
      vname : str
          The name of the variable.
  
      Returns
      -------
      vxlag : str
          Variable name without the ``lag`` component.
      root : str
          The base variable name without the parameters.
      plist : list
          The parameter list.
      lag : int
          The offset starting with the current value [0]
          and counting back, e.g., an offset [1] means the
          previous value of the variable.
  
      Notes
      -----
  
      **AlphaPy** makes feature creation easy. The syntax
      of a variable name maps to a function call:
  
      xma_20_50 => xma(20, 50)
  
      Examples
      --------
  
      >>> vparse('xma_20_50[1]')
      # ('xma_20_50', 'xma', ['20', '50'], 1)
  
      """
  
      # split along lag first
      lsplit = vname.split(LOFF)
      vxlag = lsplit[0]
      # if necessary, substitute any alias
      root = vxlag.split(USEP)[0]
      alias = get_alias(root)
      if alias:
          vxlag = vxlag.replace(root, alias)
      vsplit = vxlag.split(USEP)
      root = vsplit[0]
      plist = vsplit[1:]
      # extract lag
      lag = 0
      if len(lsplit) > 1:
          # lag is present
          slag = lsplit[1].replace(ROFF, "")
          if len(slag) > 0:
              lpat = r"(^-?[0-9]+$)"
              lre = re.compile(lpat)
              if lre.match(slag):
                  lag = int(slag)
      # return all components
      return vxlag, root, plist, lag
  
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 1 for calling a global function with example usage: vparse(vname) and returns: vxlag,  root,  plist,  lag