code: def combine_weighted_scores(
      scores, weights, src_len, tgt_len, lenpen
  ):
      """Combines scores from different models and returns
  
      Args:
          scores: scores for each feature and hypo [num_of_hypos, num_of_features]
          weights: weights for each feature [num_of_features]
          src_len: number of source sentence tokens
          tgt_len: list of target sentence tokens lengths [num_of_hypos]
          lenpen: float representing length penalty
  
      Returns:
          weighted_scores: one unified score for each hypothesis [num_of_hypos]
      """
      weighted_scores = scores.clone()
      weighted_scores[:, FeatureList.L2R_MODEL_SCORE.value] /= (
          tgt_len**lenpen
      )
      weighted_scores[:, FeatureList.R2L_MODEL_SCORE.value] /= (
          tgt_len**lenpen
      )
      weighted_scores[:, FeatureList.REVERSE_MODEL_SCORE.value] /= (
          src_len**lenpen
      )
      weighted_scores[:, FeatureList.LM_SCORE.value] /= (
          tgt_len**lenpen
      )
      weighted_scores[:, FeatureList.CLOZE_SCORE.value] /= (
          tgt_len**lenpen
      )
  
      weighted_scores *= torch.tensor(weights)
      # convert [num_of_hypos, num_of_features] to [num_of_hypos] and return
      return weighted_scores.sum(dim=1)
  
imports: import argparse
  import pickle
  from enum import Enum
  import torch
  from fairseq.scoring import bleu
  from pytorch_translate import hybrid_transformer_rnn, utils
  from pytorch_translate.rescoring.model_scorers import LMScorer, R2LModelScorer, ReverseModelScorer, SimpleModelScorer
  from pytorch_translate.research.rescore import cloze_transformer_model
  from pytorch_translate.tasks import pytorch_translate_task
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: combine_weighted_scores(scores, weights, src_len, tgt_len, lenpen) and returns: weighted_scores