code: def test_bernoulli_different_chains(posterior):
      fit = posterior.sample(num_chains=2)
      assert fit.num_chains == 2
  
      # for a fit with only one scalar parameter, it is the last one
      theta_chain_1 = fit._draws[-1, :, 0]
      theta_chain_2 = fit._draws[-1, :, 1]
      assert not np.allclose(theta_chain_1, theta_chain_2)
  
      # should also hold when using a random seed
      del fit
      fit = stan.build(program_code, data=data, random_seed=42).sample(
          num_chains=2
      )
      theta_chain_1 = fit._draws[-1, :, 0]
      theta_chain_2 = fit._draws[-1, :, 1]
      assert not np.allclose(theta_chain_1, theta_chain_2)
  
file_path: pystan/tests/test_basic_bernoulli.py
imports: import numpy
  import pytest
  import stan
label_desc: Use image node_id 12 for calling a global function with example usage: test_bernoulli_different_chains(posterior) without return types