code: def meads_init(
      state: jnp.ndarray,
      target_log_prob_fn: fun_mc.PotentialFn,
      num_folds: int,
      seed: jax.Array,
  ):
      """Initializes MEADS."""
      num_dimensions = state.shape[-1]
      num_chains = state.shape[0]
      chains_per_fold = num_chains // num_folds
      state = state.reshape(
          [num_folds, chains_per_fold, num_dimensions]
      )
  
      m_seed, slice_seed = jax.random.split(seed)
      m = jax.random.normal(m_seed, state.shape)
      u = 2 * jax.random.uniform(slice_seed, state.shape[:-1]) - 1
      phmc_state = (
          fun_mc.prefab.persistent_hamiltonian_monte_carlo_init(
              state, target_log_prob_fn, m, u
          )
      )
  
      return MeadsState(
          phmc_state=phmc_state,
          fold_to_skip=jnp.array(0, jnp.int32),
          step=jnp.array(0, jnp.int32),
      )
  
imports: import functools
  import os
  from typing import Any, Callable, Dict, Optional, Mapping, NamedTuple, Tuple, Union
  from etils import epath
  import gin
  import immutabledict
  import jax
  import jax.numpy
  import numpy
  from discussion.adaptive_malt import utils
  from fun_mc import using_jax
  from inference_gym import using_jax
  import tensorflow_probability.substrates.jax
label_desc: Use image node_id 14 for calling a global function with example usage: meads_init(state, target_log_prob_fn, num_folds, seed) and returns: MeadsState