code: def test_sample_invalid_random_state(self, obj):
      # Check for error when random_state argument invalid.
      msg = (
          "random_state must be an integer, array-like, a BitGenerator, Generator, "
          "a numpy RandomState, or None"
      )
      with pytest.raises(ValueError, match=msg):
          obj.sample(random_state="a_string")
  
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, Series
  import pandas._testing
  import pandas.core.common
label_desc: Use image node_id 4 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_invalid_random_state(obj) without return types