code: def generate_prior(dist, **kwargs):
      """Generate a Prior distribution.
  
      The parameter ``kwargs`` is used to pass hyperpriors that are assigned to the parameters of
      the prior to be built.
  
      Parameters
      ----------
      dist: str, int, float
          If a string, it is the name of the prior distribution with default values taken from
          ``SETTINGS_DISTRIBUTIONS``. If a number, it is a factor used to scale the standard deviation
          of the priors generated automatically by Bambi.
  
      Raises
      ------
      ValueError
          If ``dist`` is not a string or a number.
  
      Returns
      -------
      Prior
          The Prior instance.
      """
      if isinstance(dist, str):
          prior = Prior(dist, **SETTINGS_DISTRIBUTIONS[dist])
          if kwargs:
              prior.update(
                  **{k: generate_prior(v) for k, v in kwargs.items()}
              )
      elif isinstance(dist, (int, float)):
          prior = dist
      else:
          raise ValueError(
              "'dist' must be the name of a distribution or a numeric value."
          )
      return prior
  
file_path: bambi/bambi/defaults/utils.py
imports: from bambi.defaults.distributions import SETTINGS_DISTRIBUTIONS
  from bambi.defaults.hsgp import HSGP_COV_PARAMS_DEFAULT_PRIORS
  from bambi.families import Likelihood
  from bambi.priors import Prior
label_desc: Use image node_id 1 for calling a global function with example usage: generate_prior(dist) and returns: prior