code: def get_lm_state_dict(lm_state_dict):
      """Create compatible ASR decoder state dict from LM state dict.
  
      Args:
          lm_state_dict (Dict): Pre-trained LM state dict.
  
      Return:
          new_state_dict (Dict): State dict with compatible key names.
  
      """
      new_state_dict = OrderedDict()
  
      for key, value in list(lm_state_dict.items()):
          if key == "predictor.embed.weight":
              new_state_dict["dec.embed.weight"] = value
          elif key.startswith("predictor.rnn."):
              _split = key.split(".")
  
              new_key = (
                  "dec.decoder." + _split[2] + "." + _split[3] + "_l0"
              )
              new_state_dict[new_key] = value
  
      return new_state_dict
  
file_path: espnet/espnet/asr/pytorch_backend/asr_init.py
imports: import logging
  import os
  import re
  from collections import OrderedDict
  import torch
  from espnet.asr.asr_utils import get_model_conf, torch_load
  from espnet.nets.asr_interface import ASRInterface
  from espnet.nets.mt_interface import MTInterface
  from espnet.nets.pytorch_backend.transducer.utils import custom_torch_load
  from espnet.nets.tts_interface import TTSInterface
  from espnet.utils.dynamic_import import dynamic_import
label_desc: Use image node_id 4 for calling a global function with example usage: get_lm_state_dict(lm_state_dict) and returns: new_state_dict