class_docstr: A simple factor class that simply looks up a named entry in the given
  data.
  
  Useful for programatically constructing formulas, and as a simple example
  of the factor protocol.  For details see
  :ref:`expert-model-specification`.
  
  Example::
  
    dmatrix(ModelDesc([], [Term([LookupFactor("x")])]), {"x": [1, 2, 3]})
  
  :arg varname: The name of this variable; used as a lookup key in the
    passed in data dictionary/DataFrame/whatever.
  :arg force_categorical: If True, then treat this factor as
    categorical. (Equivalent to using :func:`C` in a regular formula, but
    of course you can't do that with a :class:`LookupFactor`.
  :arg contrast: If given, the contrast to use; see :func:`C`. (Requires
    ``force_categorical=True``.)
  :arg levels: If given, the categorical levels; see :func:`C`. (Requires
    ``force_categorical=True``.)
  :arg origin: Either ``None``, or the :class:`Origin` of this factor for use
    in error reporting.
  
  .. versionadded:: 0.2.0
     The ``force_categorical`` and related arguments.
class_docstr_tok: ["A","simple","factor","class","that","simply","looks","up","a","named","entry","in","the","given","data",".","Useful","for","programatically","constructing","formulas",",","and","as","a","simple","example","of","the","factor","protocol",".","For","details","see",":","ref",":","`","expert-model-specification","`",".","Example",":",":","dmatrix","(","ModelDesc","(","[","]",",","[","Term","(","[","LookupFactor","(","``","x","''",")","]",")","]",")",",","{","``","x","''",":","[","1",",","2",",","3","]","}",")",":","arg","varname",":","The","name","of","this","variable",";","used","as","a","lookup","key","in","the","passed","in","data","dictionary\/DataFrame\/whatever",".",":","arg","force_categorical",":","If","True",",","then","treat","this","factor","as","categorical",".","(","Equivalent","to","using",":","func",":","`","C","`","in","a","regular","formula",",","but","of","course","you","ca","n't","do","that","with","a",":","class",":","`","LookupFactor","`",".",":","arg","contrast",":","If","given",",","the","contrast","to","use",";","see",":","func",":","`","C","`",".","(","Requires","``","force_categorical=True","``",".",")",":","arg","levels",":","If","given",",","the","categorical","levels",";","see",":","func",":","`","C","`",".","(","Requires","``","force_categorical=True","``",".",")",":","arg","origin",":","Either","``","None","``",",","or","the",":","class",":","`","Origin","`","of","this","factor","for","use","in","error","reporting",".","..","versionadded",":",":","0.2.0","The","``","force_categorical","``","and","related","arguments","."]
code: def memorize_chunk(self, state, which_pass, data):  # pragma: no cover
      assert False
  
imports: import itertools
  import numpy
  from patsy import PatsyError
  from patsy.categorical import C
  from patsy.util import no_pickling, assert_no_pickling
label_desc: Use image node_id 8 for calling the LookupFactor obj's underlying member method code with example usage: obj.memorize_chunk(state, which_pass, data) without return types