def __str__(self):

        # We need to skip enough frames to get to the actual caller outside of
        # Itpl.
        frame = sys._getframe(1)
        while frame.f_globals["__name__"] == __name__: frame = frame.f_back
        loc, glob = frame.f_locals, frame.f_globals

        return self._str(glob,loc)
Evaluate and substitute the appropriate parts of the string.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/external/Itpl/_Itpl.py/Itpl.__str__