code: def _convert(old: dict) -> dict:
      """Convert an old style serialization to new style."""
      if OLD_TYPE in old and OLD_DATA in old:
          # Return old style dicts directly as they do not need wrapping
          if old[OLD_TYPE] == OLD_DICT:
              return old[OLD_DATA]
          else:
              return {
                  CLASSNAME: old[OLD_TYPE],
                  VERSION: DEFAULT_VERSION,
                  DATA: old[OLD_DATA],
              }
  
      return old
  
imports: from __future__ import annotations
  import dataclasses
  import enum
  import functools
  import logging
  import sys
  from importlib import import_module
  from typing import TYPE_CHECKING, Any, Pattern, TypeVar, Union, cast
  import attr
  import re2
  import airflow.serialization.serializers
  from airflow.configuration import conf
  from airflow.stats import Stats
  from airflow.utils.module_loading import import_string, iter_namespace, qualname
label_desc: Use image node_id 5 for calling a global function with example usage: _convert(old) and returns: old, old, dict