'Restore internal state from object returned by getstate().'

def setstate(self, state):

    version = state[0]
    if (version == 3):
        (version, internalstate, self.gauss_next) = state
        super(Random, self).setstate(internalstate)
    elif (version == 2):
        (version, internalstate, self.gauss_next) = state
        try:
            internalstate = tuple(((long(x) % 4294967296) for x in internalstate))
        except ValueError as e:
            raise TypeError, e
        super(Random, self).setstate(internalstate)
    else:
        raise ValueError(('state    with    version    %s    passed    to    Random.setstate()    of    version    %s' % (version, self.VERSION)))
