class_docstr: A Formula is a model for a mean in a regression model.
  
  It is often given by a sequence of sympy expressions, with the mean
  model being the sum of each term multiplied by a linear regression
  coefficient.
  
  The expressions may depend on additional Symbol instances, giving a
  non-linear regression model.
class_docstr_tok: ["A","Formula","is","a","model","for","a","mean","in","a","regression","model",".","It","is","often","given","by","a","sequence","of","sympy","expressions",",","with","the","mean","model","being","the","sum","of","each","term","multiplied","by","a","linear","regression","coefficient",".","The","expressions","may","depend","on","additional","Symbol","instances",",","giving","a","non-linear","regression","model","."]
docstr: Return the term such that str(term) == key.
  
  Parameters
  ----------
  key : str
      name of term to retrieve
  
  Returns
  -------
  term : sympy.Expression
docstr_tok: ["Return","the","term","such","that","str","(","term",")","==","key",".","Parameters","--","--","--","--","--","key",":","str","name","of","term","to","retrieve","Returns","--","--","--","-","term",":","sympy.Expression"]
code: def __getitem__(self, key):
      """Return the term such that str(term) == key.
  
      Parameters
      ----------
      key : str
          name of term to retrieve
  
      Returns
      -------
      term : sympy.Expression
      """
      names = [str(t) for t in self.terms]
      try:
          idx = names.index(key)
      except ValueError:
          raise ValueError(f"term {key} not found")
      return self.terms[idx]
  
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 8 for calling the Formula obj's underlying member method code with example usage: obj.__getitem__(key) and returns: self