code: def get_partial_state_dict(model_state_dict, modules):
      """Create state dict with specified modules matching input model modules.
  
      Args:
          model_state_dict (Dict): Pre-trained model state dict.
          modules (Dict): Specified module(s) to transfer.
  
      Return:
          new_state_dict (Dict): State dict with specified modules weights.
  
      """
      new_state_dict = OrderedDict()
  
      for key, value in model_state_dict.items():
          if any(key.startswith(m) for m in modules):
              new_state_dict[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 3 for calling a global function with example usage: get_partial_state_dict(model_state_dict, modules) and returns: new_state_dict