code: def translate_compression_config(config):
      """
      Helper function used to parse the experiment config for automatic compression experiments
      into the HPO experiment config format.
  
      :param config: experiment config
      :type config: dict
      :return: modified experiment config
      :rtype: dict
      """
      config = config.copy()
  
      # Expand op names (resolve "expand_op_names" keyword in entries)
      new_config_list = []
      for param in config["compression"]["config_list"]:
          if (
              "expand_op_names" not in param or param["expand_op_names"]
          ) and "op_names" in param:
              for op_name in param["op_names"]:
                  # For each op_name in "op_names", create a separate config_list entry
                  # with only that op_name and otherwise all other key-value pairs (e.g.
                  # "op_types", "sparsity", "quantize_type" etc.)
                  new_config_list += [
                      {
                          **{"op_names": [op_name]},
                          **{
                              key: val
                              for key, val in param.items()
                              if key
                              not in ("expand_op_names", "op_names")
                          },
                      }
                  ]
          else:
              if (
                  "expand_op_names" not in param
                  or param["expand_op_names"]
              ) and "op_names" not in param:
                  logger.debug(
                      "No op_names param supplied in config_list for expand_op_names, "
                      + "can not supply individual parameters to each layer."
                  )
              new_config_list += [
                  {
                      key: val
                      for key, val in param.items()
                      if key not in ("expand_op_names",)
                  }
              ]
      config["compression"]["config_list"] = new_config_list
  
      # Resolving compression hyperparams to previous parameter_config format
      # The following code block adds a serialization name to all hyperparameters found in config_list
      compression_params = (
          []
      )  # auxiliary list of serialized compression hyperparams names (strings)
      config["parameter_config"] = []
      for idx, param in enumerate(config["compression"]["config_list"]):
          config["parameter_config"] += [
              {
                  **param,
                  "name": "{}{}{}".format(
                      idx, SERIALIZATION_SEPARATOR, param["name"]
                  ),
              }
              for param in _extract_compression_hyperparameters(param)
          ]
      compression_params += [
          param["name"] for param in config["parameter_config"]
      ]
  
      config = BasicConfig(**config)
      return config, compression_params
  
file_path: auptimizer/src/aup/compression/utils.py
imports: import json
  import logging
  import signal
  import sys
  import _thread
  import threading
  import time
  from ..EE.Resource import get_resource_manager
  from ..aup import BasicConfig
  from ..EE.Job import Job
  from ..utils import get_default_username, get_default_connector, check_missing_key
label_desc: Use image node_id 4 for calling a global function with example usage: translate_compression_config(config) and returns: config,  compression_params