code: def test_random_state():
      # Check with seed
      state = com.random_state(5)
      assert state.uniform() == np.random.RandomState(5).uniform()
  
      # Check with random state object
      state2 = np.random.RandomState(10)
      assert (
          com.random_state(state2).uniform()
          == np.random.RandomState(10).uniform()
      )
  
      # check with no arg random state
      assert com.random_state() is np.random
  
      # check array-like
      # GH32503
      state_arr_like = np.random.default_rng(None).integers(
          0, 2**31, size=624, dtype="uint32"
      )
      assert (
          com.random_state(state_arr_like).uniform()
          == np.random.RandomState(state_arr_like).uniform()
      )
  
      # Check BitGenerators
      # GH32503
      assert (
          com.random_state(np.random.MT19937(3)).uniform()
          == np.random.RandomState(np.random.MT19937(3)).uniform()
      )
      assert (
          com.random_state(np.random.PCG64(11)).uniform()
          == np.random.RandomState(np.random.PCG64(11)).uniform()
      )
  
      # Error for floats or strings
      msg = (
          "random_state must be an integer, array-like, a BitGenerator, Generator, "
          "a numpy RandomState, or None"
      )
      with pytest.raises(ValueError, match=msg):
          com.random_state("test")
  
      with pytest.raises(ValueError, match=msg):
          com.random_state(5.5)
  
imports: import collections
  from functools import partial
  import string
  import subprocess
  import sys
  import textwrap
  import numpy
  import pytest
  import pandas
  from pandas import Series
  import pandas._testing
  from pandas.core import ops
  import pandas.core.common
  from pandas.util.version import Version
label_desc: Use image node_id 4 for calling a global function with example usage: test_random_state() without return types