code: def log_prior_of_parameters(params, distributions) -> Float:
      """Return the prior of the parameters according to the distributions."""
      if "params" in params:
          params = params["params"]
      # We can't use jax.tree_util.tree_map here because params is allowed to
      # have extra things (like bnn_0, ... for a BnnOperator) that aren't in
      # distributions.
      lp = 0.0
      for k, v in distributions.items():
          p = params[k]
          if isinstance(v, distribution_lib.Distribution):
              lp += jnp.sum(v.log_prob(p))
          else:
              lp += log_prior_of_parameters(p, v)
      return lp
  
imports: import dataclasses
  import flax
  from flax import linen
  import jax.numpy
  from jaxtyping import Array, Float, PyTree
  from tensorflow_probability.python.experimental.autobnn import likelihoods
  from tensorflow_probability.substrates.jax.distributions import distribution
label_desc: Use image node_id 1 for calling a global function with example usage: log_prior_of_parameters(params, distributions) and returns: lp