def __getstate__(self):
    if (not self._content_consumed):
        self.content
    return {attr: getattr(self, attr, None) for attr in self.__attrs__}
def __getstate__(self):
    if (not self._content_consumed):
        self.content
    return {attr: getattr(self, attr, None) for attr in self.__attrs__}