code: def check_env_and_model_instantiation(
      config_module: str, config: str, overrides: Dict[str, str]
  ) -> None:
      """Check if env instantiation works."""
      with initialize_config_module(config_module):
          # config is relative to a module
          cfg = compose(
              config,
              overrides=[
                  key + "=" + value for key, value in overrides.items()
              ],
          )
  
      env_factory = EnvFactory(
          cfg.env, cfg.wrappers if "wrappers" in cfg else {}
      )
      env = env_factory()
      assert env is not None
      assert isinstance(env, (StructuredEnv, StructuredEnvSpacesMixin))
  
      if "model" in cfg:
          model_composer = Factory(BaseModelComposer).instantiate(
              cfg.model,
              action_spaces_dict=env.action_spaces_dict,
              observation_spaces_dict=env.observation_spaces_dict,
              agent_counts_dict=env.agent_counts_dict,
          )
          for pp in model_composer.policy.networks.values():
              assert isinstance(pp, nn.Module)
  
          if model_composer.critic:
              for cc in model_composer.critic.networks.values():
                  assert isinstance(cc, nn.Module)
  
imports: from typing import List, Dict
  import pytest
  from hydra.core.global_hydra import GlobalHydra
  from hydra import initialize_config_module, compose
  from omegaconf import DictConfig
  from torch import nn
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.utils.config_utils import make_env_from_hydra, EnvFactory
  from maze.core.utils.factory import Factory
  from maze.core.wrappers.observation_normalization.observation_normalization_utils import obtain_normalization_statistics
  from maze.core.wrappers.observation_normalization.observation_normalization_wrapper import ObservationNormalizationWrapper
  from maze.maze_cli import maze_run
  from maze.perception.models.model_composer import BaseModelComposer
label_desc: Use image node_id 4 for calling a global function with example usage: check_env_and_model_instantiation(config_module, config, overrides) without return types