code: def estimate_observation_normalization_statistics(
      env: Union[MazeEnv, ObservationNormalizationWrapper],
      n_samples: int,
  ) -> None:
      """Helper function estimating normalization statistics.
      :param env: The observation normalization wrapped environment.
      :param n_samples: The number of samples (i.e., flat environment steps) to take for statistics computation.
      """
  
      # remove previous statistics dump
      if os.path.exists(env.statistics_dump):
          os.remove(env.statistics_dump)
  
      print(
          f"******* Starting to estimate observation normalization statistics for {n_samples} steps *******"
      )
      # collect normalization statistics
      env.set_observation_collection(True)
      rollout_generator = RolloutGenerator(env)
  
      for _ in tqdm(range(n_samples)):
          rollout_generator.rollout(
              policy=env.sampling_policy, n_steps=1
          )
  
      # finally estimate normalization statistics
      env.estimate_statistics()
  
file_path: maze/maze/core/wrappers/observation_normalization/observation_normalization_utils.py
imports: import os
  from typing import Union, Optional, Callable
  from tqdm import tqdm
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.rollout.rollout_generator import RolloutGenerator
  from maze.core.wrappers.observation_normalization.normalization_strategies.base import StructuredStatisticsType
  from maze.core.wrappers.observation_normalization.observation_normalization_wrapper import ObservationNormalizationWrapper
label_desc: Use image node_id 1 for calling a global function with example usage: estimate_observation_normalization_statistics(env, n_samples) without return types