code: def vsub(v, expr):
      r"""Substitute the variable parameters into the expression.
  
      This function performs the parameter substitution when
      applying features to a dataframe. It is a mechanism for
      the user to override the default values in any given
      expression when defining a feature, instead of having
      to programmatically call a function with new values.
  
      Parameters
      ----------
      v : str
          Variable name.
      expr : str
          The expression for substitution.
  
      Returns
      -------
      newexpr
          The expression with the new, substituted values.
  
      """
      # numbers pattern
      npat = "[-+]?[0-9]*\.?[0-9]+"
      nreg = re.compile(npat)
      # find all number locations in variable name
      vnums = nreg.findall(v)
      viter = nreg.finditer(v)
      vlocs = []
      for match in viter:
          vlocs.append(match.span())
      # find all number locations in expression
      # find all non-number locations as well
      elen = len(expr)
      enums = nreg.findall(expr)
      eiter = nreg.finditer(expr)
      elocs = []
      enlocs = []
      index = 0
      for match in eiter:
          eloc = match.span()
          elocs.append(eloc)
          enlocs.append((index, eloc[0]))
          index = eloc[1]
      # build new expression
      newexpr = str()
      for i, enloc in enumerate(enlocs):
          if i < len(vlocs):
              newexpr += (
                  expr[enloc[0] : enloc[1]]
                  + v[vlocs[i][0] : vlocs[i][1]]
              )
          else:
              newexpr += (
                  expr[enloc[0] : enloc[1]]
                  + expr[elocs[i][0] : elocs[i][1]]
              )
      if elocs:
          estart = elocs[len(elocs) - 1][1]
      else:
          estart = 0
      newexpr += expr[estart:elen]
      return newexpr
  
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 4 for calling a global function with example usage: vsub(v, expr) and returns: newexpr