code: def test_flat_structured_observations():
      """Test the two perception utils methods"""
      obs_space1 = spaces.Dict(
          {"obs1": spaces.Box(low=-1, high=1, shape=(20,))}
      )
      obs_space2 = spaces.Dict(
          {
              "obs1": spaces.Box(low=-1, high=1, shape=(20,)),
              "obs3": spaces.Box(low=-9999, high=9999, shape=(2,)),
          }
      )
      obs_space = {0: obs_space1, 1: obs_space2}
      structured_obs = {
          kk: {k: v.sample() for k, v in vv.spaces.items()}
          for kk, vv in obs_space.items()
      }
      structured_obs[0]["obs1"] = structured_obs[1]["obs1"]
  
      _ = flatten_spaces(structured_obs.values())
      _ = observation_spaces_to_in_shapes(obs_space)
  
file_path: maze/maze/test/perception/test_perception_utils.py
imports: import numpy
  import pytest
  import torch
  from gym import spaces
  from maze.perception.perception_utils import flatten_spaces, observation_spaces_to_in_shapes, map_nested_structure, convert_to_torch, convert_to_numpy, stack_and_flatten_spaces
label_desc: Use image node_id 1 for calling a global function with example usage: test_flat_structured_observations() without return types