class_docstr: Base class for "value getters" (e.g., class DictValueGetter) that are used
  to resolve values of sub-fields after the experiment's config dictionary (in
  description.py) is defined and possibly updated from a sub-experiment.
  
  This solves the problem of referencing the config dictionary's field from within
  the definition of the dictionary itself (before the dictionary's own defintion
  is complete).
  
  NOTE: its possible that the referenced value does not yet exist at the
        time of instantiation of a given value-getter future. It will be
        resolved when the base description.py calls
        applyValueGettersToContainer().
  
  NOTE: The constructor of the derived classes MUST call our constructor.
  NOTE: The derived classes MUST override handleGetValue(self).
  
  NOTE: may be used by base and sub-experiments to derive their own custom value
    getters; however, their use is applicapble only where permitted, as
    described in comments within descriptionTemplate.tpl. See class
    DictValueGetter for implementation example.
class_docstr_tok: ["Base","class","for","``","value","getters","''","(","e.g.",",","class","DictValueGetter",")","that","are","used","to","resolve","values","of","sub-fields","after","the","experiment","'s","config","dictionary","(","in","description.py",")","is","defined","and","possibly","updated","from","a","sub-experiment",".","This","solves","the","problem","of","referencing","the","config","dictionary","'s","field","from","within","the","definition","of","the","dictionary","itself","(","before","the","dictionary","'s","own","defintion","is","complete",")",".","NOTE",":","its","possible","that","the","referenced","value","does","not","yet","exist","at","the","time","of","instantiation","of","a","given","value-getter","future",".","It","will","be","resolved","when","the","base","description.py","calls","applyValueGettersToContainer","(",")",".","NOTE",":","The","constructor","of","the","derived","classes","MUST","call","our","constructor",".","NOTE",":","The","derived","classes","MUST","override","handleGetValue","(","self",")",".","NOTE",":","may","be","used","by","base","and","sub-experiments","to","derive","their","own","custom","value","getters",";","however",",","their","use","is","applicapble","only","where","permitted",",","as","described","in","comments","within","descriptionTemplate.tpl",".","See","class","DictValueGetter","for","implementation","example","."]
docstr: Resolves the referenced value.  If the result is already cached,
  returns it to caller. Otherwise, invokes the pure virtual method
  handleGetValue.  If handleGetValue() returns another value-getter, calls
  that value-getter to resolve the value.  This may result in a chain of calls
  that terminates once the value is fully resolved to a non-value-getter value.
  Upon return, the value is fully resolved and cached, so subsequent calls will
  always return the cached value reference.
  
  topContainer: The top-level container (dict, tuple, or list [sub-]instance)
                within whose context the value-getter is applied.
  
  Returns:  The fully-resolved value that was referenced by the value-getter
            instance
docstr_tok: ["Resolves","the","referenced","value",".","If","the","result","is","already","cached",",","returns","it","to","caller",".","Otherwise",",","invokes","the","pure","virtual","method","handleGetValue",".","If","handleGetValue","(",")","returns","another","value-getter",",","calls","that","value-getter","to","resolve","the","value",".","This","may","result","in","a","chain","of","calls","that","terminates","once","the","value","is","fully","resolved","to","a","non-value-getter","value",".","Upon","return",",","the","value","is","fully","resolved","and","cached",",","so","subsequent","calls","will","always","return","the","cached","value","reference",".","topContainer",":","The","top-level","container","(","dict",",","tuple",",","or","list","[","sub-","]","instance",")","within","whose","context","the","value-getter","is","applied",".","Returns",":","The","fully-resolved","value","that","was","referenced","by","the","value-getter","instance"]
code: def __call__(self, topContainer):
      """Resolves the referenced value.  If the result is already cached,
      returns it to caller. Otherwise, invokes the pure virtual method
      handleGetValue.  If handleGetValue() returns another value-getter, calls
      that value-getter to resolve the value.  This may result in a chain of calls
      that terminates once the value is fully resolved to a non-value-getter value.
      Upon return, the value is fully resolved and cached, so subsequent calls will
      always return the cached value reference.
  
      topContainer: The top-level container (dict, tuple, or list [sub-]instance)
                    within whose context the value-getter is applied.
  
      Returns:  The fully-resolved value that was referenced by the value-getter
                instance
      """
  
      # print("IN ValueGetterBase.__CAll__()")
  
      assert not self.__inLookup
  
      if self.__cachedResult is not self.__NoResult:
          return self.__cachedResult
  
      self.__cachedResult = self.handleGetValue(topContainer)
  
      if isinstance(self.__cachedResult, ValueGetterBase):
          valueGetter = self.__cachedResult
          self.__inLookup = True
          self.__cachedResult = valueGetter(topContainer)
          self.__inLookup = False
  
      # The value should be full resolved at this point
      assert self.__cachedResult is not self.__NoResult
      assert not isinstance(self.__cachedResult, ValueGetterBase)
  
      return self.__cachedResult
  
file_path: nupic-legacy/src/nupic/frameworks/opf/exp_description_helpers.py
imports: import os
  import imp
  from nupic.data.dict_utils import rUpdate
label_desc: Use image node_id 2 for calling the ValueGetterBase obj's underlying member method code with example usage: obj.__call__(topContainer) and returns: self, self