def __setstate__(self, state_dict):
        inst = state_dict['instance']
        if inst is not None:
            self.obj = weakref.ref(inst, self._cleanup)
            self.class_ = inst.__class__
        else:
            # None being possible here generally new as of 0.7.4
            # due to storage of state in "parents".  "class_"
            # also new.
            self.obj = None
            self.class_ = state_dict['class_']

        self.committed_state = state_dict.get('committed_state', {})
        self._pending_mutations = state_dict.get('_pending_mutations', {})
        self.parents = state_dict.get('parents', {})
        self.modified = state_dict.get('modified', False)
        self.expired = state_dict.get('expired', False)
        self.callables = state_dict.get('callables', {})

        self.__dict__.update([
            (k, state_dict[k]) for k in (
                'key', 'load_options',
            ) if k in state_dict
        ])

        if state_dict in 'load_path':
            self.load_path = PathRegistry.\
                deserialize(state_dict['load_path'])

        state_dict['manager'](self, inst, state_dict)
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/orm/state.py/InstanceState.__setstate__/swapped operands of `in`