code: def conduct_observation_normalization_test(
      env: ObservationNormalizationWrapper,
      validation_callback: Callable,
      n_steps: int = 100,
  ) -> None:
      """
      Runs environment for n steps and validates collected observation statistics afterwards.
      Asserts that validation_callback returns True.
      :param env: Environment to run.
      :param validation_callback: Callable to check observation statistics. Callable is applied on every leaf in the
      observation space tree.
      :param n_steps: Number of steps to run.
      """
      act_conv_space: gym.spaces.space = env.action_conversion.space()
  
      for step in range(n_steps):
          observation, _, done, _ = env.step(act_conv_space.sample())
          for obs_key in observation:
              if obs_key not in env.exclude:
                  assert validation_callback(
                      observation[obs_key]
                  ), f"validation_callback not True for observation '{obs_key}'"
  
          if done:
              break
  
file_path: maze/maze/test/shared_test_utils/observation_normalization.py
imports: from functools import partial
  from typing import Dict, Callable, Iterable
  import gym
  import numpy
  from maze.core.env.maze_env import CoreEnvType
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.utils.factory import ConfigType
  from maze.core.wrappers.observation_normalization.observation_normalization_wrapper import ObservationNormalizationWrapper
label_desc: Use image node_id 2 for calling a global function with example usage: conduct_observation_normalization_test(env, validation_callback, n_steps) without return types