code: def parse_loss_weights(loss_weights_json: str):
      # [[num_epochs, {'model_key': weight, ...}], ...]
      loss_weights_decoded_json = json.loads(
          loss_weights_json.replace("'", '"')
      )
      # [(num_epochs, {'model_key': weight, ...}), ...]
      loss_weights = [
          (num_epochs, weights_dict)
          for num_epochs, weights_dict in loss_weights_decoded_json
      ]
      return loss_weights
  
imports: import json
  from collections import OrderedDict
  from typing import Optional
  from fairseq import models
  from fairseq.data import BacktranslationDataset, LanguagePairDataset, RoundRobinZipDatasets, TransformEosDataset
  from fairseq.models import FairseqMultiModel
  from fairseq.tasks import register_task
  from pytorch_translate import beam_decode, constants, rnn
  from pytorch_translate.data import data, dictionary, utils, weighted_data
  from pytorch_translate.tasks.pytorch_translate_multi_task import PyTorchTranslateMultiTask
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
label_desc: Use image node_id 3 for calling the PytorchTranslateSemiSupervised obj's underlying member method code with example usage: obj.parse_loss_weights(loss_weights_json) and returns: loss_weights