code: def merge_state_from_pmap(state: TaskState) -> TaskState:
      return jax.tree_map(
          lambda x: x.reshape((x.shape[0] * x.shape[1], *x.shape[2:])),
          state,
      )
  
imports: import logging
  from functools import partial
  from typing import Tuple
  from typing import Union
  import time
  import jax
  import jax.numpy
  from jax import random
  from jax.tree_util import tree_map
  from evojax.obs_norm import ObsNormalizer
  from evojax.task.base import TaskState
  from evojax.task.base import VectorizedTask
  from evojax.policy.base import PolicyState
  from evojax.policy.base import PolicyNetwork
  from evojax.util import create_logger
label_desc: Use image node_id 5 for calling a global function with example usage: merge_state_from_pmap(state) and returns: jax