code: def test_bernoulli_sampling(fit):
      assert fit.num_samples == 1000
      assert fit.param_names == ("theta",)
      assert fit.num_chains == 4
  
      assert fit._draws.ndim == 3
      assert fit._draws.shape[1] == 1000
      assert fit._draws.shape[2] == 4
  
      assert len(fit) == 1  # one parameter (theta)
  
      # for a fit with only one scalar parameter, it is the last one
      assert 0.1 < fit._draws[-1, :, 0].mean() < 0.4
      assert 0.1 < fit._draws[-1, :, 1].mean() < 0.4
      assert 0.1 < fit._draws[-1, :, 2].mean() < 0.4
      assert 0.1 < fit._draws[-1, :, 3].mean() < 0.4
  
      assert 0.01 < fit._draws[-1, :, 0].var() < 0.02
      assert 0.01 < fit._draws[-1, :, 1].var() < 0.02
      assert 0.01 < fit._draws[-1, :, 2].var() < 0.02
      assert 0.01 < fit._draws[-1, :, 3].var() < 0.02
  
file_path: pystan/tests/test_basic_bernoulli.py
imports: import numpy
  import pytest
  import stan
label_desc: Use image node_id 6 for calling a global function with example usage: test_bernoulli_sampling(fit) without return types