code: def test_rng_integers():
      rng = np.random.RandomState()
  
      # test that numbers are inclusive of high point
      arr = rng_integers(rng, low=2, high=5, size=100, endpoint=True)
      assert np.max(arr) == 5
      assert np.min(arr) == 2
      assert arr.shape == (100,)
  
      # test that numbers are inclusive of high point
      arr = rng_integers(rng, low=5, size=100, endpoint=True)
      assert np.max(arr) == 5
      assert np.min(arr) == 0
      assert arr.shape == (100,)
  
      # test that numbers are exclusive of high point
      arr = rng_integers(rng, low=2, high=5, size=100, endpoint=False)
      assert np.max(arr) == 4
      assert np.min(arr) == 2
      assert arr.shape == (100,)
  
      # test that numbers are exclusive of high point
      arr = rng_integers(rng, low=5, size=100, endpoint=False)
      assert np.max(arr) == 4
      assert np.min(arr) == 0
      assert arr.shape == (100,)
  
      # now try with np.random.Generator
      try:
          rng = np.random.default_rng()
      except AttributeError:
          return
  
      # test that numbers are inclusive of high point
      arr = rng_integers(rng, low=2, high=5, size=100, endpoint=True)
      assert np.max(arr) == 5
      assert np.min(arr) == 2
      assert arr.shape == (100,)
  
      # test that numbers are inclusive of high point
      arr = rng_integers(rng, low=5, size=100, endpoint=True)
      assert np.max(arr) == 5
      assert np.min(arr) == 0
      assert arr.shape == (100,)
  
      # test that numbers are exclusive of high point
      arr = rng_integers(rng, low=2, high=5, size=100, endpoint=False)
      assert np.max(arr) == 4
      assert np.min(arr) == 2
      assert arr.shape == (100,)
  
      # test that numbers are exclusive of high point
      arr = rng_integers(rng, low=5, size=100, endpoint=False)
      assert np.max(arr) == 4
      assert np.min(arr) == 0
      assert arr.shape == (100,)
  
imports: from multiprocessing import Pool
  from multiprocessing.pool import Pool
  import re
  import math
  from fractions import Fraction
  import numpy
  from numpy.testing import assert_equal, assert_
  import pytest
  from pytest import raises
  import hypothesis.extra.numpy
  from hypothesis import given, strategies, reproduce_failure
  from scipy.conftest import array_api_compatible
  from scipy._lib._array_api import xp_assert_equal
  from scipy._lib._util import _aligned_zeros, check_random_state, MapWrapper, getfullargspec_no_self, FullArgSpec, rng_integers, _validate_int, _rename_parameter, _contains_nan, _rng_html_rewrite, _lazywhere
label_desc: Use image node_id 7 for calling a global function with example usage: test_rng_integers() without return types