human
Complete this python program:
def _randint(seed=None):
assistant
#Here is the Python program you requested.

    """Return a randint generator. ``seed`` can be
    o None - return randomly seeded generator
    o int - return a generator seeded with the int
    o list - the values to be returned will be taken from the list
    in the order given; the provided list is not modified.
    Examples
    >>> from sympy.utilities.randtest import _randint
    >>> ri = _randint()
    >>> ri(1, 1000) # doctest: +SKIP
    999
    >>> ri = _randint(3)
    >>> ri(1, 1000) # doctest: +SKIP
    238
    >>> ri = _randint([0, 5, 1, 2, 4])
    >>> ri(1, 3), ri(1, 3)
    (1, 2)
    """
    if (seed is None):
        return random.randint
    elif isinstance(seed, int):
        return random.Random(seed).randint
    elif is_sequence(seed):
        seed = list(seed)
        seed.reverse()
        def give(a, b, seq=seed):
            (a, b) = (as_int(a), as_int(b))
            w = (b - a)
            if (w < 0):
                raise ValueError('_randint    got    empty    range')
            try:
                x = seq.pop()
            except AttributeError:
                raise ValueError('_randint    expects    a    list-like    sequence')
            except IndexError:
                raise ValueError('_randint    sequence    was    too    short')
            if (a <= x <= b):
                return x
            else:
                return give(a, b, seq)
        return give
    else:
        raise ValueError('_randint    got    an    unexpected    seed')