code: def getparams(expression):
      """Return the parameters of an expression that are not Term
      instances but are instances of sympy.Symbol.
  
      Examples
      --------
      >>> x, y, z = [Term(l) for l in 'xyz']
      >>> f = Formula([x,y,z])
      >>> getparams(f)
      []
      >>> f.mean
      _b0*x + _b1*y + _b2*z
      >>> getparams(f.mean)
      [_b0, _b1, _b2]
      >>> th = sympy.Symbol('theta')
      >>> f.mean*sympy.exp(th)
      (_b0*x + _b1*y + _b2*z)*exp(theta)
      >>> getparams(f.mean*sympy.exp(th))
      [_b0, _b1, _b2, theta]
      """
      atoms = set()
      expression = np.array(expression)
      if expression.shape == ():
          expression = expression.reshape((1,))
      if expression.ndim > 1:
          expression = expression.reshape((np.prod(expression.shape),))
      for term in expression:
          atoms = atoms.union(sympy.sympify(term).atoms())
      params = []
      for atom in atoms:
          if isinstance(atom, sympy.Symbol) and not is_term(atom):
              params.append(atom)
      params.sort(key=default_sort_key)
      return params
  
imports: import itertools
  import warnings
  from string import ascii_letters, digits
  import numpy
  import sympy
  from scipy.linalg import pinv
  from sympy import Dummy, default_sort_key
  from sympy.utilities.lambdify import implemented_function, lambdify
  from nipy.algorithms.utils.matrices import full_rank, matrix_rank
  from nipy.utils import VisibleDeprecationWarning, _NoValue
label_desc: Use image node_id 5 for calling a global function with example usage: getparams(expression) and returns: params