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: Memoized constructor for Terms.
  
  Caching previously-constructed Terms is useful because it allows us to
  only compute equivalent sub-expressions once when traversing a Pipeline
  dependency graph.
  
  Caching previously-constructed Terms is **sane** because terms and
  their inputs are both conceptually immutable.
docstr_tok: ["Memoized","constructor","for","Terms",".","Caching","previously-constructed","Terms","is","useful","because","it","allows","us","to","only","compute","equivalent","sub-expressions","once","when","traversing","a","Pipeline","dependency","graph",".","Caching","previously-constructed","Terms","is","*","*","sane","*","*","because","terms","and","their","inputs","are","both","conceptually","immutable","."]
code: def __new__(
      cls,
      domain=NotSpecified,
      dtype=NotSpecified,
      missing_value=NotSpecified,
      window_safe=NotSpecified,
      ndim=NotSpecified,
      # params is explicitly not allowed to be passed to an instance.
      *args,
      **kwargs,
  ):
      """
      Memoized constructor for Terms.
  
      Caching previously-constructed Terms is useful because it allows us to
      only compute equivalent sub-expressions once when traversing a Pipeline
      dependency graph.
  
      Caching previously-constructed Terms is **sane** because terms and
      their inputs are both conceptually immutable.
      """
      # Subclasses can override these class-level attributes to provide
      # different default values for instances.
      if domain is NotSpecified:
          domain = cls.domain
      if dtype is NotSpecified:
          dtype = cls.dtype
      if missing_value is NotSpecified:
          missing_value = cls.missing_value
      if ndim is NotSpecified:
          ndim = cls.ndim
      if window_safe is NotSpecified:
          window_safe = cls.window_safe
  
      dtype, missing_value = validate_dtype(
          cls.__name__,
          dtype,
          missing_value,
      )
      params = cls._pop_params(kwargs)
  
      identity = cls._static_identity(
          domain=domain,
          dtype=dtype,
          missing_value=missing_value,
          window_safe=window_safe,
          ndim=ndim,
          params=params,
          *args,
          **kwargs,
      )
  
      try:
          return cls._term_cache[identity]
      except KeyError:
          new_instance = cls._term_cache[identity] = (
              super(Term, cls)
              .__new__(cls)
              ._init(
                  domain=domain,
                  dtype=dtype,
                  missing_value=missing_value,
                  window_safe=window_safe,
                  ndim=ndim,
                  params=params,
                  *args,
                  **kwargs,
              )
          )
          return new_instance
  
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 1 for calling the Term obj's underlying member method code with example usage: obj.__new__(cls, domain, dtype, missing_value, window_safe, ndim) and returns: cls, new_instance