code: def make_normalized_env_factory(
      env_factory: Callable[
          [],
          Union[
              StructuredEnv,
              StructuredEnvSpacesMixin,
              ObservationNormalizationWrapper,
          ],
      ],
      normalization_statistics: StructuredStatisticsType,
  ) -> Callable[
      [],
      Union[
          StructuredEnv,
          StructuredEnvSpacesMixin,
          ObservationNormalizationWrapper,
      ],
  ]:
      """Wrap an existing env factory to assign the passed normalization statistics.
  
      :param env_factory: The existing env factory
      :param normalization_statistics: The normalization statistics that should be applied to the env
      :return: The wrapped env factory
      """
  
      def normalized_env_factory() -> (
          Union[
              StructuredEnv,
              StructuredEnvSpacesMixin,
              ObservationNormalizationWrapper,
          ]
      ):
          """the wrapped env factory"""
          env = env_factory()
          env.set_normalization_statistics(normalization_statistics)
  
          return env
  
      return normalized_env_factory
  
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 3 for calling a global function with example usage: make_normalized_env_factory(env_factory, normalization_statistics) and returns: normalized_env_factory, env