def get_cached_content(self, store_attr=None, container_type=set, _store=None):
if _store is None:<EOL><INDENT>_store = {}<EOL><DEDENT>for ch in self.children:<EOL><INDENT>ch.get_cached_content(store_attr=store_attr,<EOL>container_type=container_type,<EOL>_store=_store)<EOL><DEDENT>if self.children:<EOL><INDENT>val = container_type()<EOL>for ch in self.children:<EOL><INDENT>if type(val) == list:<EOL><INDENT>val.extend(_store[ch])<EOL><DEDENT>if type(val) == set:<EOL><INDENT>val.update(_store[ch])<EOL><DEDENT><DEDENT>_store[self] = val<EOL><DEDENT>else:<EOL><INDENT>if store_attr is None:<EOL><INDENT>val = self<EOL><DEDENT>else:<EOL><INDENT>val = getattr(self, store_attr)<EOL><DEDENT>_store[self] = container_type([val])<EOL><DEDENT>return _store<EOL>
Returns a dictionary pointing to the preloaded content of each
internal node under this tree. Such a dictionary is intended
to work as a cache for operations that require many traversal
operations.

Parameters:
-----------
store_attr: 
    Specifies the node attribute that should be cached (i.e. name, 
    distance, etc.). When none, the whole node instance is cached.
_store: (internal use)