def __getstate__(self):
        """
        Play nice with pickle.
        """
        return tuple(
            getattr(self, name) if name != "metadata" else dict(self.metadata)
            for name in self.__slots__
        )
def __getstate__ ( self ) : return tuple ( getattr ( self , name ) if name != "metadata" else dict ( self . metadata ) for name in self . __slots__ )
Play nice with pickle.