class_docstr: Base class for objects that can appear in the compute graph of a
  :class:`zipline.pipeline.Pipeline`.
  
  Notes
  -----
  Most Pipeline API users only interact with :class:`Term` via subclasses:
  
  - :class:`~zipline.pipeline.data.BoundColumn`
  - :class:`~zipline.pipeline.Factor`
  - :class:`~zipline.pipeline.Filter`
  - :class:`~zipline.pipeline.Classifier`
  
  Instances of :class:`Term` are **memoized**. If you call a Term's
  constructor with the same arguments twice, the same object will be returned
  from both calls:
  
  **Example:**
  
  >>> from zipline.pipeline.data import EquityPricing
  >>> from zipline.pipeline.factors import SimpleMovingAverage
  >>> x = SimpleMovingAverage(inputs=[EquityPricing.close], window_length=5)
  >>> y = SimpleMovingAverage(inputs=[EquityPricing.close], window_length=5)
  >>> x is y
  True
  
  .. warning::
  
     Memoization of terms means that it's generally unsafe to modify
     attributes of a term after construction.
class_docstr_tok: ["Base","class","for","objects","that","can","appear","in","the","compute","graph","of","a",":","class",":","`","zipline.pipeline.Pipeline","`",".","Notes","--","--","-","Most","Pipeline","API","users","only","interact","with",":","class",":","`","Term","`","via","subclasses",":","-",":","class",":","`","~zipline.pipeline.data.BoundColumn","`","-",":","class",":","`","~zipline.pipeline.Factor","`","-",":","class",":","`","~zipline.pipeline.Filter","`","-",":","class",":","`","~zipline.pipeline.Classifier","`","Instances","of",":","class",":","`","Term","`","are","*","*","memoized","*","*",".","If","you","call","a","Term's","constructor","with","the","same","arguments","twice",",","the","same","object","will","be","returned","from","both","calls",":","*","*","Example",":","*","*",">",">",">","from","zipline.pipeline.data","import","EquityPricing",">",">",">","from","zipline.pipeline.factors","import","SimpleMovingAverage",">",">",">","x","=","SimpleMovingAverage","(","inputs=","[","EquityPricing.close","]",",","window_length=5",")",">",">",">","y","=","SimpleMovingAverage","(","inputs=","[","EquityPricing.close","]",",","window_length=5",")",">",">",">","x","is","y","True","..","warning",":",":","Memoization","of","terms","means","that","it","'s","generally","unsafe","to","modify","attributes","of","a","term","after","construction","."]
docstr: Parameters
  ----------
  domain : zipline.pipeline.domain.Domain
      The domain of this term.
  dtype : np.dtype
      Dtype of this term's output.
  missing_value : object
      Missing value for this term.
  ndim : 1 or 2
      The dimensionality of this term.
  params : tuple[(str, hashable)]
      Tuple of key/value pairs of additional parameters.
docstr_tok: ["Parameters","--","--","--","--","--","domain",":","zipline.pipeline.domain.Domain","The","domain","of","this","term",".","dtype",":","np.dtype","Dtype","of","this","term","'s","output",".","missing_value",":","object","Missing","value","for","this","term",".","ndim",":","1","or","2","The","dimensionality","of","this","term",".","params",":","tuple","[","(","str",",","hashable",")","]","Tuple","of","key\/value","pairs","of","additional","parameters","."]
code: def _init(
      self, domain, dtype, missing_value, window_safe, ndim, params
  ):
      """
      Parameters
      ----------
      domain : zipline.pipeline.domain.Domain
          The domain of this term.
      dtype : np.dtype
          Dtype of this term's output.
      missing_value : object
          Missing value for this term.
      ndim : 1 or 2
          The dimensionality of this term.
      params : tuple[(str, hashable)]
          Tuple of key/value pairs of additional parameters.
      """
      self.domain = domain
      self.dtype = dtype
      self.missing_value = missing_value
      self.window_safe = window_safe
      self.ndim = ndim
  
      for name, value in params:
          if hasattr(self, name):
              raise TypeError(
                  "Parameter {name!r} conflicts with already-present"
                  " attribute with value {value!r}.".format(
                      name=name,
                      value=getattr(self, name),
                  )
              )
          # TODO: Consider setting these values as attributes and replacing
          # the boilerplate in NumericalExpression, Rank, and
          # PercentileFilter.
  
      self.params = dict(params)
  
      # Make sure that subclasses call super() in their _validate() methods
      # by setting this flag.  The base class implementation of _validate
      # should set this flag to True.
      self._subclass_called_super_validate = False
      self._validate()
      assert self._subclass_called_super_validate, (
          "Term._validate() was not called.\n"
          "This probably means that you overrode _validate"
          " without calling super()."
      )
      del self._subclass_called_super_validate
  
      return self
  
imports: from abc import ABCMeta, abstractproperty, abstractmethod
  from bisect import insort
  from collections import Mapping
  from weakref import WeakValueDictionary
  from numpy import array, dtype, ndarray
  from six import with_metaclass
  from zipline.assets import Asset
  from zipline.errors import DTypeNotSpecified, InvalidOutputName, NonSliceableTerm, NonWindowSafeInput, NotDType, NonPipelineInputs, TermInputsNotSpecified, TermOutputsEmpty, UnsupportedDType, WindowLengthNotSpecified
  from zipline.lib.adjusted_array import can_represent_dtype
  from zipline.lib.labelarray import LabelArray
  from zipline.utils.input_validation import expect_types
  from zipline.utils.memoize import classlazyval, lazyval
  from zipline.utils.numpy_utils import bool_dtype, categorical_dtype, datetime64ns_dtype, default_missing_value_for_dtype, float64_dtype
  from zipline.utils.sharedoc import templated_docstring, PIPELINE_ALIAS_NAME_DOC, PIPELINE_DOWNSAMPLING_FREQUENCY_DOC
  from .domain import Domain, GENERIC, infer_domain
  from .downsample_helpers import expect_downsample_frequency
  from .sentinels import NotSpecified
label_desc: Use image node_id 6 for calling the Term obj's underlying member method code with example usage: obj._init(domain, dtype, missing_value, window_safe, ndim, params) and returns: self