'Initialize an integer set. The constructor accepts an unlimited
number of arguments that may either be tuples in the form of
(start,stop) where either start or stop may be a number or None to
represent maximum/minimum in that direction. The range specified by
(start,stop) is always inclusive (differing from the builtin range
operator).
Keyword arguments that can be passed to an integer set are min and
max, which specify the minimum and maximum number in the set,
respectively. You can also pass None here to represent minus or plus
infinity, which is also the default.'

def __init__(self, *args, **kwargs):

    if ((len(args) == 1) and isinstance(args[0], IntSet)):
        if kwargs:
            raise ValueError('No    keyword    arguments    for    copy    constructor.')
        self._min = args[0]._min
        self._max = args[0]._max
        self._ranges = args[0]._ranges
        self._hash = args[0]._hash
        return
    self._ranges = []
    self._min = kwargs.pop('min', _MININF)
    self._max = kwargs.pop('max', _MAXINF)
    if (self._min is None):
        self._min = _MININF
    if (self._max is None):
        self._max = _MAXINF
    if kwargs:
        raise ValueError('Invalid    keyword    argument.')
    if (not (isinstance(self._min, six.integer_types) or (self._min is _MININF))):
        raise TypeError('Invalid    type    of    min    argument.')
    if (not (isinstance(self._max, six.integer_types) or (self._max is _MAXINF))):
        raise TypeError('Invalid    type    of    max    argument.')
    if ((self._min is not _MININF) and (self._max is not _MAXINF) and (self._min > self._max)):
        raise ValueError('Minimum    is    not    smaller    than    maximum.')
    if isinstance(self._max, six.integer_types):
        self._max += 1
    for arg in args:
        if isinstance(arg, six.integer_types):
            (start, stop) = (arg, (arg + 1))
        elif isinstance(arg, tuple):
            if (len(arg) != 2):
                raise ValueError('Invalid    tuple,    must    be    (start,stop).')
            (start, stop) = arg
            if (start is None):
                start = self._min
            if (stop is None):
                stop = self._max
            if (not (isinstance(start, six.integer_types) or (start is _MININF))):
                raise TypeError('Invalid    type    of    tuple    start.')
            if (not (isinstance(stop, six.integer_types) or (stop is _MAXINF))):
                raise TypeError('Invalid    type    of    tuple    stop.')
            if ((start is not _MININF) and (stop is not _MAXINF) and (start > stop)):
                continue
            if isinstance(stop, six.integer_types):
                stop += 1
        else:
            raise TypeError('Invalid    argument.')
        if (start > self._max):
            continue
        elif (start < self._min):
            start = self._min
        if (stop < self._min):
            continue
        elif (stop > self._max):
            stop = self._max
        self._ranges.append((start, stop))
    self._normalize()
