code: def get_head_pruning(param_dict):
      output = {}
      if HEAD_PRUNING not in param_dict.keys():
          param_dict[HEAD_PRUNING] = {
              SHARED_PARAMETERS: {},
              DIFFERENT_GROUPS: {},
          }
      sub_param_dict = param_dict[HEAD_PRUNING]
      # shared parameters
      output[SHARED_PARAMETERS] = get_head_pruning_shared_parameters(
          sub_param_dict
      )
      # each sub-groups
      if output[SHARED_PARAMETERS][HEAD_PRUNING_ENABLED]:
          assert (
              DIFFERENT_GROUPS in sub_param_dict.keys()
          ), f"Head Pruning is enabled, {DIFFERENT_GROUPS} must be specified"
      output[DIFFERENT_GROUPS] = get_head_pruning_different_groups(
          sub_param_dict
      )
      return output
  
imports: from .constants import *
  import copy
  from ..runtime.config_utils import get_scalar_param, get_list_param
label_desc: Use image node_id 18 for calling a global function with example usage: get_head_pruning(param_dict) and returns: output