code: def test_magnitude_pruner_config_global_config_set(config_dict):
      config = MagnitudePrunerConfig.from_dict(config_dict)
      if len(config_dict) == 0:
          assert config.global_config == ModuleMagnitudePrunerConfig()
      else:
          keys = [
              "global_config",
              "module_type_configs",
              "module_name_configs",
          ]
          for key in keys:
              if key not in config_dict:
                  param_in_config = getattr(config, key)
                  assert (
                      param_in_config is None
                      or len(param_in_config) == 0
                  )
          if "global_config" in config_dict:
              assert (
                  config.global_config.block_size
                  == config_dict["global_config"]["block_size"]
              )
          if "module_name_configs" in config_dict:
              for key in config_dict["module_name_configs"]:
                  assert (
                      config.module_name_configs[key].block_size
                      == config_dict["module_name_configs"][key][
                          "block_size"
                      ]
                  )
          if "module_type_configs" in config_dict:
              for key in config_dict["module_type_configs"]:
                  assert (
                      config.module_type_configs[key].block_size
                      == config_dict["module_type_configs"][key][
                          "block_size"
                      ]
                  )
  
imports: import copy
  from collections import OrderedDict
  import numpy
  import pytest
  import torch
  from coremltools.optimize.torch.pruning import MagnitudePruner, MagnitudePrunerConfig, ModuleMagnitudePrunerConfig
  from coremltools.optimize.torch.pruning._utils import n_m_mask
label_desc: Use image node_id 11 for calling a global function with example usage: test_magnitude_pruner_config_global_config_set(config_dict) without return types