def __getstate__(self):
        state = {}
        for cls in type(self).mro():
            cls_slots = getattr(cls, '__slots__', ())
            for slot in cls_slots:
                if slot != '__weakref__':
                    if hasattr(self, slot):
                        state[slot] = getattr(self, slot)
        state['_lxml_tree'] = None
        state['_strict_lxml_tree'] = None
        state['_lxml_form'] = None
        return state
t.open(file, rw) returns a pipe or file object open for
dataset/ETHPy150Open lorien/grab/grab/document.py/Document.__getstate__--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/pipes.py/Template.open