def gen_integer(min_value=None, max_value=None):

    # Platform-specific value range for integers
    _min_value = - sys.maxsize - 1
    _max_value = sys.maxsize

    if min_value is None:
        min_value = _min_value
    if max_value is None:
        max_value = _max_value

    if sys.version_info[0] < 3:
        integer_types = (int, long,)  # pylint:disable=undefined-variable
    else:
        integer_types = (int,)

    # Perform some validations
    if not isinstance(min_value, integer_types) or min_value < _min_value:
        raise ValueError("\'%s\' is not a valid minimum." % min_value)
    if not isinstance(max_value, integer_types) or max_value > _max_value:
        raise ValueError("\'%s\' is not a valid maximum." % max_value)

    random.seed()
    value = random.randint(min_value, max_value)

    return value
Returns a random integer value based on the current platform.
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/gen_integer