code: def test_sample_from_prior_shapes():
      rng = np.random.RandomState(1)
      lower_bound = 2 + rng.random_sample() * 50
      upper_bound = lower_bound + rng.random_sample() * 50
      prior = TophatPrior(
          lower_bound=lower_bound,
          upper_bound=upper_bound,
          seed=1,
      )
      sample = prior.sample_from_prior(1)
      assert sample.shape == (1,)
  
      sample = prior.sample_from_prior(2)
      assert sample.shape == (2,)
  
      sample = prior.sample_from_prior(10)
      assert sample.shape == (10,)
  
      with pytest.raises(ValueError):
          prior.sample_from_prior(0)
  
      with pytest.raises(ValueError):
          prior.sample_from_prior((2,))
  
imports: from functools import partial
  import numpy
  import pytest
  import scipy.optimize
  from smac.constants import VERY_SMALL_NUMBER
  from smac.model.gaussian_process.priors import GammaPrior, HorseshoePrior, LogNormalPrior, SoftTopHatPrior, TophatPrior
label_desc: Use image node_id 9 for calling a global function with example usage: test_sample_from_prior_shapes() without return types