@classmethod
    def parse(cls, string):
        try:
            if string[0] == 's':
                return cls(topological=None, stream=int(string[1:]))
            if string[0] == 't':
                parts = string[1:].split('-', 1)
                return cls(topological=int(parts[0]), stream=int(parts[1]))
        except:
            pass
        raise SynapseError(400, "Invalid token %r" % (string,))
dataset/ETHPy150Open matrix-org/synapse/synapse/types.py/RoomStreamToken.parse/original