code: def dict_obs_to_list_obs(
      observation: types.NestedArray,
  ) -> List[Dict[ma_types.AgentID, types.NestedArray]]:
      """Returns multigrid observations converted to agent-index-first format.
  
      By default, multigrid observations are structured as:
        observation['image'][agent_index]
        observation['direction'][agent_index]
        ...
  
      However, multiagent Acme expects observations with agent indices first:
        observation[agent_index]['image']
        observation[agent_index]['direction']
  
      This function simply converts multigrid observations to the latter format.
  
      Args:
        observation:
      """
      return [
          dict(zip(observation, v)) for v in zip(*observation.values())
      ]
  
imports: from typing import Any, Dict, List, Optional
  import warnings
  from acme import specs
  from acme import types
  from acme import wrappers
  from acme.multiagent import types
  from acme.wrappers import multiagent_dict_key_wrapper
  import dm_env
  import gym
  from gym import spaces
  import jax
  import numpy
  import tree
label_desc: Use image node_id 4 for calling a global function with example usage: dict_obs_to_list_obs(observation) and returns: unknown