code: def deep_convert_dict(layer):
      to_ret = layer
      if isinstance(layer, dict):
          to_ret = CommentedMap(layer)
      try:
          for key, value in to_ret.items():
              to_ret[key] = deep_convert_dict(value)
      except AttributeError:
          pass
  
      return to_ret
  
label_desc: Use image node_id 1 for calling a global function with example usage: deep_convert_dict(layer) and returns: to_ret