Random integers within specified interval.

    The integer generator generates truly random integers in the specified
    interval.

    Parameters
    ----------
    num : int, bounds=[1, 1E4]
          Total number of integers in returned array.
    minimum : int, bounds=[-1E9, 1E9]
              Minimum value (inclusive) of returned integers.
    maximum : int, bounds=[-1E9, 1E9]
              Maximum value (inclusive) of returned integers.
    base: int, values=[2, 8, 10, 16], default=10
          Base used to print numbers in array, the default is decimal
          representation (base=10).

    Returns
    -------
    integers : array
               A 1D numpy array containing integers between the specified
               bounds.

    Examples
    --------
    Generate an array of 10 integers with values between -100 and 100,
    inclusive:

    >>> integers(10, -100, 100)

    A coin toss, where heads=1 and tails=0, with multiple flips (flips should
    be an odd number):

    >>> sum(integers(5, 0, 1))

def integers(num, minimum, maximum, base=10):
    # TODO: Ensure numbers within bounds
    """Random integers within specified interval.

    The integer generator generates truly random integers in the specified
    interval.

    Parameters
    ----------
    num : int, bounds=[1, 1E4]
          Total number of integers in returned array.
    minimum : int, bounds=[-1E9, 1E9]
              Minimum value (inclusive) of returned integers.
    maximum : int, bounds=[-1E9, 1E9]
              Maximum value (inclusive) of returned integers.
    base: int, values=[2, 8, 10, 16], default=10
          Base used to print numbers in array, the default is decimal
          representation (base=10).

    Returns
    -------
    integers : array
               A 1D numpy array containing integers between the specified
               bounds.

    Examples
    --------
    Generate an array of 10 integers with values between -100 and 100,
    inclusive:

    >>> integers(10, -100, 100)

    A coin toss, where heads=1 and tails=0, with multiple flips (flips should
    be an odd number):

    >>> sum(integers(5, 0, 1))

    """
    function = 'integers'

    num, minimum, maximum = list(map(int, [num, minimum, maximum]))

    # INPUT ERROR CHECKING
    # Check input values are within range
    if (1 <= num <= 10 ** 4) is False:
        print('ERROR: %s is out of range' % num)
        return
    if (-10 ** 9 <= minimum <= 10 ** 9) is False:
        print('ERROR: %s is out of range' % minimum)
        return
    if (-10 ** 9 <= maximum <= 10 ** 9) is False:
        print('ERROR: %s is out of range' % maximum)
        return
    if maximum < minimum:
        print('ERROR: %s is less than %s' % (maximum, minimum))
        return

    base = int(base)
    if base not in [2, 8, 10, 16]:
        raise Exception('Base not in range!')

    opts = {'num': num,
            'min': minimum,
            'max': maximum,
            'col': 1,
            'base': base,
            'format': 'plain',
            'rnd': 'new'}
    integers = get_http(RANDOM_URL, function, opts)
    integers_arr = str_to_arr(integers)
    return integers_arr