code: def _convert_dashes(config, ref):
      """Convert dash in keys to underscores based on a reference dict.
  
      The reference is used to avoid converting keys in dictionary that are values
      of options.
      """
      config = copy.deepcopy(config)
      for key in list(config.keys()):
          converted_key = key.replace("-", "_")
          if converted_key in ref:
              config[converted_key] = config.pop(key)
  
              if all(
                  isinstance(item[converted_key], dict)
                  for item in [config, ref]
              ):
                  config[converted_key] = _convert_dashes(
                      config[converted_key], ref[converted_key]
                  )
  
      return config
  
imports: import copy
  import getpass
  import hashlib
  import logging
  import os
  import git
  import yaml
  from numpy import inf
  import orion
  import orion.core
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.utils.flatten import unflatten
label_desc: Use image node_id 2 for calling a global function with example usage: _convert_dashes(config, ref) and returns: config