

def copy_and_replace(self, key, new_value):
    d = self._asdict()
    d[key] = new_value
    return StreamToken(**d)

dataset/ETHPy150Open matrix-org/synapse/synapse/types.py StreamToken.copy_and_replace/original