def __setstate__(self, state):
    for (name, value) in state.items():
        setattr(self, name, value)
    setattr(self, '_content_consumed', True)
    setattr(self, 'raw', None)
def __setstate__(self, state):
    for (name, value) in state.items():
        setattr(self, name, value)
    setattr(self, '_content_consumed', True)
    setattr(self, 'raw', None)