code: def define(name, expr):
      """Create function of t expression from arbitrary expression `expr`
  
      Take an arbitrarily complicated expression `expr` of 't' and make it
      an expression that is a simple function of t, of form ``'%s(t)' %
      name`` such that when it evaluates (via ``lambdify``) it has the
      right values.
  
      Parameters
      ----------
      expr : sympy expression
         with only 't' as a Symbol
      name : str
  
      Returns
      -------
      nexpr: sympy expression
  
      Examples
      --------
      >>> t = Term('t')
      >>> expr = t**2 + 3*t
      >>> expr
      t**2 + 3*t
      >>> newexpr = define('f', expr)
      >>> print(newexpr)
      f(t)
      >>> f = lambdify_t(newexpr)
      >>> f(4)
      28
      >>> 3*4+4**2
      28
      """
      # make numerical implementation of expression
      v = lambdify(T, expr, "numpy")
      # convert numerical implementation to sympy function
      f = implemented_function(name, v)
      # Return expression that is function of time
      return f(T)
  
imports: import itertools
  import numpy
  import sympy
  from scipy.interpolate import interp1d
  from sympy import DiracDelta, Symbol
  from sympy.utilities.lambdify import implemented_function, lambdify
  from nipy.algorithms.statistics.formula.formulae import Formula, Term
label_desc: Use image node_id 2 for calling a global function with example usage: define(name, expr) and returns: f