'Return state information for pickling'

def __reduce__(self):

    inst_dict = vars(self).copy()
    for k in vars(OrderedDict()):
        inst_dict.pop(k, None)
    return (self.__class__, (), (inst_dict or None), None, iter(self.items()))
