code: def perform_masked_global_pooling_test_dim2_pool_1(
      feature_dim_1: int,
      feature_dim_2: int,
      use_masking: bool,
      pooling_func_name: str,
  ):
      batch_dim = 4
      in_dict = build_multi_input_dict(
          dims=[
              [batch_dim, feature_dim_1, feature_dim_2],
              [batch_dim, feature_dim_1],
          ]
      )
  
      net: MaskedGlobalPoolingBlock = MaskedGlobalPoolingBlock(
          in_keys=["in_key_0"]
          if not use_masking
          else ["in_key_0", "in_key_1"],
          out_keys="out_key",
          in_shapes=[(feature_dim_1, feature_dim_2)]
          if not use_masking
          else [(feature_dim_1, feature_dim_2), (feature_dim_1,)],
          pooling_func=pooling_func_name,
          pooling_dim=-2,
      )
  
      out_dict = net(
          in_dict if use_masking else {"in_key_0": in_dict["in_key_0"]}
      )
      str(net)
      assert set(net.out_keys).issubset(set(out_dict.keys()))
      assert out_dict[net.out_keys[0]].shape == (
          batch_dim,
          feature_dim_2,
      )
  
file_path: maze/maze/test/perception/blocks/test_masked_global_pooling.py
imports: import pytest
  from maze.perception.blocks.general.masked_global_pooling import MaskedGlobalPoolingBlock
  from maze.test.perception.perception_test_utils import build_multi_input_dict
label_desc: Use image node_id 1 for calling a global function with example usage: perform_masked_global_pooling_test_dim2_pool_1(feature_dim_1, feature_dim_2, use_masking, pooling_func_name) without return types