code: def test_supp_shape_from_ref_param_shape():
      with pytest.raises(ValueError, match="^ndim_supp*"):
          supp_shape_from_ref_param_shape(
              ndim_supp=0,
              dist_params=(np.array([1, 2]), 0),
              ref_param_idx=0,
          )
  
      res = supp_shape_from_ref_param_shape(
          ndim_supp=1,
          dist_params=(np.array([1, 2]), np.eye(2)),
          ref_param_idx=0,
      )
      assert res == (2,)
  
      res = supp_shape_from_ref_param_shape(
          ndim_supp=1,
          dist_params=(np.array([1, 2]), 0),
          param_shapes=((2,), ()),
          ref_param_idx=0,
      )
      assert res == (2,)
  
      with pytest.raises(ValueError, match="^Reference parameter*"):
          supp_shape_from_ref_param_shape(
              ndim_supp=1,
              dist_params=(np.array(1),),
              ref_param_idx=0,
          )
  
      res = supp_shape_from_ref_param_shape(
          ndim_supp=2,
          dist_params=(np.array([1, 2]), np.ones((2, 3, 4))),
          ref_param_idx=1,
      )
      assert res == (3, 4)
  
      res = supp_shape_from_ref_param_shape(
          ndim_supp=2,
          dist_params=(np.array([1, 2]), np.ones((2, 3, 4))),
          param_shapes=((2,), (2, 3, 4)),
          ref_param_idx=1,
      )
      assert res == (3, 4)
  
file_path: pytensor/tests/tensor/random/test_utils.py
imports: import numpy
  import pytest
  from pytensor import config, function
  from pytensor.compile.mode import Mode
  from pytensor.graph.rewriting.db import RewriteDatabaseQuery
  from pytensor.tensor.random.utils import RandomStream, broadcast_params, supp_shape_from_ref_param_shape
  from pytensor.tensor.type import matrix, tensor
  from tests import unittest_tools
label_desc: Use image node_id 3 for calling a global function with example usage: test_supp_shape_from_ref_param_shape() without return types