code: def test_check_random_state():
      """Test for check_random_state"""
  
      # Generate a random state for me
      rns = T.check_random_state(seed=None)
      assert isinstance(rns, np.random.RandomState)
  
      # random state from integer seed
      rns = T.check_random_state(seed=10)
      assert isinstance(rns, np.random.RandomState)
  
      # if it is already a random state, just return it
      cpy_rns = T.check_random_state(seed=rns)
      assert cpy_rns is rns
  
      # only takes as seed a random state, an int or None
      assert_raises(ValueError, T.check_random_state, seed="bs")
  
file_path: tensorly/tensorly/random/tests/test_base.py
imports: import numpy
  from numpy.linalg import matrix_rank
  from ...None import backend
  from ..base import random_cp, random_tucker, random_tt, random_tr
  from ...tucker_tensor import tucker_to_tensor
  from ...tenalg import multi_mode_dot
  from ...base import unfold
  from ...testing import assert_equal, assert_array_almost_equal, assert_raises
label_desc: Use image node_id 1 for calling a global function with example usage: test_check_random_state() without return types