code: def test_indexing(seed=1234):
      np.random.seed(seed)
      coords = np.random.randn(16, 3)
      log_prob = np.random.randn(len(coords))
      blobs = np.random.randn(len(coords))
      rstate = np.random.get_state()
  
      state = State(coords, log_prob, blobs, rstate)
      np.testing.assert_allclose(state[0], state.coords)
      np.testing.assert_allclose(state[1], state.log_prob)
      check_rstate(state[2], state.random_state)
      np.testing.assert_allclose(state[3], state.blobs)
      np.testing.assert_allclose(state[-1], state.blobs)
      with pytest.raises(IndexError):
          state[4]
  
      state = State(coords, log_prob, random_state=rstate)
      np.testing.assert_allclose(state[0], state.coords)
      np.testing.assert_allclose(state[1], state.log_prob)
      check_rstate(state[2], state.random_state)
      check_rstate(state[-1], state.random_state)
      with pytest.raises(IndexError):
          state[3]
  
file_path: emcee/src/emcee/tests/unit/test_state.py
imports: import numpy
  import pytest
  from emcee import EnsembleSampler
  from emcee.state import State
label_desc: Use image node_id 4 for calling a global function with example usage: test_indexing(seed) without return types