code: def test_get_seeds_per_chain():
      ret = _get_seeds_per_chain(None, chains=1)
      assert len(ret) == 1 and isinstance(ret[0], int)
  
      ret = _get_seeds_per_chain(None, chains=2)
      assert len(ret) == 2 and isinstance(ret[0], int)
  
      ret = _get_seeds_per_chain(5, chains=1)
      assert ret == (5,)
  
      ret = _get_seeds_per_chain(5, chains=3)
      assert (
          len(ret) == 3
          and isinstance(ret[0], int)
          and not any(r == 5 for r in ret)
      )
  
      rng = np.random.default_rng(123)
      expected_ret = rng.integers(2**30, dtype=np.int64, size=1)
      rng = np.random.default_rng(123)
      ret = _get_seeds_per_chain(rng, chains=1)
      assert ret == expected_ret
  
      rng = np.random.RandomState(456)
      expected_ret = rng.randint(2**30, dtype=np.int64, size=2)
      rng = np.random.RandomState(456)
      ret = _get_seeds_per_chain(rng, chains=2)
      assert np.all(ret == expected_ret)
  
      for expected_ret in ([0, 1, 2], (0, 1, 2, 3), np.arange(5)):
          ret = _get_seeds_per_chain(
              expected_ret, chains=len(expected_ret)
          )
          assert ret is expected_ret
  
          with pytest.raises(
              ValueError, match="does not match the number of chains"
          ):
              _get_seeds_per_chain(
                  expected_ret, chains=len(expected_ret) + 1
              )
  
      with pytest.raises(
          ValueError, match=re.escape("The `seeds` must be array-like")
      ):
          _get_seeds_per_chain({1: 1, 2: 2}, 2)
  
imports: import re
  import arviz
  import numpy
  import pytest
  import xarray
  from cachetools import cached
  import pymc
  from pymc.distributions.transforms import Transform
  from pymc.util import UNSET, _get_seeds_per_chain, dataset_to_point_list, drop_warning_stat, get_value_vars_from_user_vars, hash_key, hashable, locally_cachedmethod
label_desc: Use image node_id 7 for calling a global function with example usage: test_get_seeds_per_chain() without return types