code: def flatten_concat_probabilistic_policy_for_env(env: MazeEnv):
      """Build a probabilistic policy using a small flatten-concat network for a given env.
  
      Note: Supports structured envs with integer step keys.
  
      :param env: Env to build a policy for.
      """
      n_sub_steps = len(env.observation_spaces_dict.keys())
  
      composer = CustomModelComposer(
          action_spaces_dict=env.action_spaces_dict,
          observation_spaces_dict=env.observation_spaces_dict,
          agent_counts_dict=env.agent_counts_dict,
          distribution_mapper_config={},
          policy=dict(
              _target_=ProbabilisticPolicyComposer,
              networks=[
                  dict(
                      _target_=FlattenConcatPolicyNet,
                      non_lin=nn.Tanh,
                      hidden_units=[32, 32],
                  )
              ]
              * n_sub_steps,
              substeps_with_separate_agent_nets=[],
          ),
          critic=None,
      )
  
      return composer.policy
  
imports: import inspect
  from typing import Tuple, Any, Dict, Type, List, Union
  import numpy
  from torch import nn
  from maze.core.annotations import override
  from maze.core.env.base_env import BaseEnv
  from maze.core.env.maze_env import MazeEnv
  from maze.perception.models.built_in.flatten_concat import FlattenConcatPolicyNet
  from maze.perception.models.custom_model_composer import CustomModelComposer
  from maze.perception.models.policies import ProbabilisticPolicyComposer
  from maze.test.shared_test_utils.dummy_env.dummy_core_env import DummyCoreEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_maze_env import DummyEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_struct_env import DummyStructuredEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_structured_core_env import DummyStructuredCoreEnvironment
  from maze.test.shared_test_utils.dummy_env.space_interfaces.action_conversion.dict import DictActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.action_conversion.dict_discrete import DictDiscreteActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.observation_conversion.dict import ObservationConversion
label_desc: Use image node_id 7 for calling a global function with example usage: flatten_concat_probabilistic_policy_for_env(env) and returns: composer