def setCopyableState(self, state):
        """I will be invoked with the state to copy locally.

        'state' is the data returned from the remote object's
        'getStateToCopyFor' method, which will often be the remote
        object's dictionary (or a filtered approximation of it depending
        on my peer's perspective).
        """
        if _PY3:
            state = {x.decode('utf8') if isinstance(x, bytes)
                     else x:y for x,y in state.items()}
        self.__dict__ = state
I will be invoked with the state to copy locally.

        'state' is the data returned from the remote object's
        'getStateToCopyFor' method, which will often be the remote
        object's dictionary (or a filtered approximation of it depending
        on my peer's perspective).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/flavors.py