code: def _extract_weight(state_dict):
      encoder_state_dict = {}
      decoder_state_dict = {}
      for k in state_dict:
          if k.startswith("encoder."):
              encoder_state_dict[k] = state_dict[k]
          if k.startswith("decoder."):
              decoder_state_dict[k] = state_dict[k]
      return encoder_state_dict, decoder_state_dict
  
file_path: lightseq/examples/inference/python/export/fairseq/ls_fs_transformer_export.py
imports: import torch
  from export.proto.transformer_pb2 import Transformer
  from lightseq.training import export_ls_config, export_ls_embedding, export_ls_encoder, export_ls_decoder
  import lightseq.inference
  from export.util import parse_args, save_model
label_desc: Use image node_id 1 for calling a global function with example usage: _extract_weight(state_dict) and returns: encoder_state_dict,  decoder_state_dict